vue-merge-component
v0.0.6
Published
merge vue component async to load
Downloads
10
Maintainers
Readme
vue-merge-component for vue
Vue.use(require('vue-merge-component'))
Vue.merge_component(['nvHeader','nvFooter','nvMenu'],(resolve)=>{
require(['./views/common/header.vue','./views/common/footer.vue','./views/common/menu.vue'], (nvHeader,nvFooter,nvMenu)=>{
resolve([nvHeader,nvFooter,nvMenu])
})
})
If you use "vue-resource" you can put it in the back of the Vue.use("vue-resource"), because reuse Vue.Promise
example
Vue.use(require('vue-resource'))
Vue.use(require('vue-merge-component'))
Vue.merge_component(['nvHeader','nvFooter','nvMenu'],(resolve)=>{
require(['./views/common/header.vue','./views/common/footer.vue','./views/common/menu.vue'], (nvHeader,nvFooter,nvMenu)=>{
resolve([nvHeader,nvFooter,nvMenu])
})
})