w***@163.com
w***@163.com
  • 发布:2021-09-14 17:15
  • 更新:2021-09-14 17:15
  • 阅读:1171

支付宝小程序测试版this.$nextTick的回调中用ref拿不到子组件的方法

分类:uni-app

产品分类: 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  

})

bug描述:

支付宝小程序测试版this.$nextTick的回调中用ref拿不到子组件的方法,加延时器都得大于50ms

2021-09-14 17:15 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复