this.$nextTick(function() {
console.log( this.$refs.com ); //undefined
})
产品分类: uniapp/小程序/阿里
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win10
HBuilderX类型: 正式
HBuilderX版本号: 3.1.22
第三方开发者工具版本号: 2.3 Stable
基础库版本号: 1.25.1
项目创建方式: HBuilderX
this.$nextTick(function() {
console.log( this.$refs.com ); //undefined
})
this.$nextTick(function() {
console.log( this.$refs.com ); //undefined
})
this.$nextTick(function() {
console.log( this.$refs.com.getList() ); //值
})
this.$nextTick(function() {
console.log( this.$refs.com.getList() ); //undefined
})
支付宝小程序测试版this.$nextTick的回调中用ref拿不到子组件的方法,加延时器都得大于50ms
0 个回复