Skip to content

feature:新增全局组件声明功能 #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 4, 2018

Conversation

steinslin
Copy link
Member

主要思路是,通过对Vue.component的静态处理,解析出全局组件,然后添加到所有组件的components中,采用Object.assign进行merge,局部组件声明的会覆盖全局组件,另外有一些限制条件:

  • 只有被解析为isApp的页面进行全局组件的声明才会进行处理,比如要在src/main.js中进行声明
  • 由于是静态解析下面这种情况是不生效的,会给出相应的错误提示
const name = 'xxx'
Vue.component(name, component)

@steinslin steinslin changed the base branch from master to develop May 1, 2018 14:06
@aOrz aOrz merged commit 4cc294f into mpvue:develop May 4, 2018
BugKun pushed a commit to BugKun/mpvue-loader that referenced this pull request Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants