You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A project may contains different versions of Vue, but the designing of plugin system is not designed for that.
The plugin would be available for only one vue library, no matter how many vue libs you require.
// My Plugin.exportdefault{install(Vue,options){Vue.doSomething=function(){...}}}
// Module 01 in my project.importVuefrom'vue'// Maybe vue 2.2importMyPluginfrom'my-plugin'Vue.use(MyPlugin)Vue.doSomething()// Yeah.
// Module 02 in my project.importVuefrom'vue'// Maybe vue 2.3.importMyPluginfrom'my-plugin'Vue.use(MyPlugin)// It doesn't work because "installed" has already been set to "true".Vue.doSomething()// Boom! Undefined!
What does the proposed API look like?
So this is what I'm doing:
// My Plugin.exportdefaultfunction(){return{install(Vue,options){Vue.doSomething=function(){...}}}}
// Module 01 and 02 in my project.importVuefrom'vue'importMyPluginfrom'my-plugin'Vue.use(MyPlugin())VuedoSomething()// Yeah!
Same as "data" properity.
Hope can be improved.😀
The text was updated successfully, but these errors were encountered:
What problem does this feature solve?
A project may contains different versions of Vue, but the designing of plugin system is not designed for that.
The plugin would be available for only one vue library, no matter how many vue libs you require.
What does the proposed API look like?
So this is what I'm doing:
Same as "data" properity.
Hope can be improved.😀
The text was updated successfully, but these errors were encountered: