Skip to content

enhanceApp options should merge options we pass #1631

@flozero

Description

@flozero

Feature request

actually i am building additional page from components with docs

https://github.com/f3ltron/vuepress-plugin-docgen

// https://github.com/vuejs/vuepress/blob/master/packages/%40vuepress/core/lib/client/app.js#L88

const options = {}

  try {
    appEnhancers.forEach(enhancer => {
      if (typeof enhancer === 'function') {
        enhancer({ Vue, options, router, siteData, isServer })
      }
    })
  } catch (e) {
    console.error(e)
  }

  const app = new Vue(
    Object.assign(options, {
      router,
      render (h) {
        return h('div', { attrs: { id: 'app' }}, [
          h('router-view', { ref: 'layout' }),
          h('div', { class: 'global-ui' }, globalUIComponents.map(component => h(component)))
        ])
      }
    })
  )

What problem does this feature solve?

when we use some front plugin like vue18n in my case by letting me merge my options into options there will be no more bug for $t is not define

What does the proposed API look like?

The merge should merge dynamically our options

Are you willing to work on this yourself?

i can if it's accepted

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions