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

文档关于按需引入那块,建议写的详细点 #3302

Closed
inuyasha2012 opened this issue Mar 6, 2017 · 2 comments
Closed

文档关于按需引入那块,建议写的详细点 #3302

inuyasha2012 opened this issue Mar 6, 2017 · 2 comments

Comments

@inuyasha2012
Copy link

文档就举了两个例子,还全是component和use方式的引入

事实上看源码,有些组件压根不能用component或use方式引入

例如message,你若Vue.use(message),初次载入立马弹出消息,$message没有绑定this

看源码,应该是Vue.prototype.$message = Message的方式引入

按这种方式引入的组件还不少

Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
Vue.prototype.$confirm = MessageBox.confirm;
Vue.prototype.$prompt = MessageBox.prompt;
Vue.prototype.$notify = Notification;
Vue.prototype.$message = Message;

还有Loading组件

正确的按需引入方式应该是

Vue.use(Loading.directive);
Vue.prototype.$loading = Loading.service;

所以,建议更改下文档

@DanielWLam
Copy link

看了你的说明才用对了Loading,自己研究得搞好久,谢谢了

@pisse
Copy link

pisse commented May 6, 2017

确实按需引入模块例子太少,明明是简单的模块,废了白天都不知道咋用

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

No branches or pull requests

4 participants