不异步的方式:
Vue.component('child', {
props: ['message'],
template: '<span>{{ message }}</span>'
})
异步组件的时候 props该怎么放?
Vue.component('async-webpack-example', function (resolve) {
require(['./my-async-component'], resolve)
})
自己瞎试了几种写法都失败了..
不异步的方式:
Vue.component('child', {
props: ['message'],
template: '<span>{{ message }}</span>'
})
异步组件的时候 props该怎么放?
Vue.component('async-webpack-example', function (resolve) {
require(['./my-async-component'], resolve)
})
自己瞎试了几种写法都失败了..
11 回答1.3k 阅读
4 回答573 阅读✓ 已解决
3 回答860 阅读
2 回答587 阅读
1 回答684 阅读
同样也是利用props来向子组件传值, 异步组件只是加载组件的方式不一样而已.