vue中有异步组件功能https://vuejs.org.cn/guide/components.html#异步组件
但是异步组件里面怎么绑定事件呢?换句话说,怎么才能像正常组件那样双向绑定数据?
Vue.component('async-example', function (resolve, reject) {
setTimeout(function () {
resolve({
template: 'I am async!
'
})
}, 1000)
})
其中的click,model都是无效的,该怎么操作才能使用呢?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
为什么不行呢?
补充:
增加绑定数据部分
这样不行么?