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.
25 lines
507 B
25 lines
507 B
import Vue from '../../../dist/vue.runtime.common.js'
|
|
|
|
// async component!
|
|
const Foo = () => import('./comp')
|
|
|
|
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)
|
|
})
|
|
})
|
|
}
|
|
|