You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import Vue from '../../../dist/vue.runtime.common.js'
|
|
|
|
|
|
|
|
// async component!
|
|
|
|
const Foo = () => import('./async-foo')
|
|
|
|
const Bar = () => import('./async-bar') // eslint-disable-line
|
|
|
|
|
|
|
|
export default context => {
|
|
|
|
return new Promise(resolve => {
|
|
|
|
context.msg = 'hello'
|
|
|
|
const vm = new Vue({
|
|
|
|
render (h) {
|
|
|
|
return h('div', [
|
|
|
|
context.url,
|
|
|
|
h(Foo)
|
|
|
|
])
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
// simulate router.onReady
|
|
|
|
Foo().then(comp => {
|
|
|
|
// resolve now to make the render sync
|
|
|
|
Foo.resolved = Vue.extend(comp)
|
|
|
|
resolve(vm)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|