Skip to content
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

vue中如何全局使用? #21

Open
lizongwen opened this issue Jan 27, 2018 · 2 comments
Open

vue中如何全局使用? #21

lizongwen opened this issue Jan 27, 2018 · 2 comments
Labels

Comments

@lizongwen
Copy link

lizongwen commented Jan 27, 2018

vue中如何全局使用?难倒要每个vue组件使用它都要import引入?

@proYang
Copy link
Owner

proYang commented Jan 27, 2018

如果你使用了webpack等打包工具,每个vue文件import引入不会有额外影响,最多可能写起来麻烦。如果你真的想全局引入,可以直接通过script标签引入,挂载到全局变量上。

@proYang proYang added the 疑问 label Mar 3, 2018
@cklwblove
Copy link

如果是vue-cli生成的项目,可以直接在 main.js 引用,然后挂载到 window 上即可

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants