<u-waterfall v-model="list" ref="uWaterfall">
<template v-slot:left="{ leftList }">
<view v-for="(item, index) in leftList" :key="index">
<wItem :info.sync="item"></wItem>
</view>
</template>
<template v-slot:right="{ rightList }">
<view v-for="(item, index) in rightList" :key="index">
<wItem :info.sync="item"></wItem>
</view>
</template>
</u-waterfall>
onReady() {
console.log(this.$refs); // 报错
}

- 发布:2021-11-16 16:58
- 更新:2021-12-30 15:26
- 阅读:692
【报Bug】ios hbuilderX 3.2.9 修改子包内容,热加载后 主包使用的refs ( this.$refs 在onReady nextTick 后调用) 获取为null 报错;
产品分类: HbuilderX
PC开发环境操作系统: Mac
PC开发环境操作系统版本号: i5
HBuilderX版本号: 3.2.14
操作步骤:
预期结果:
refs 子组件加载正常; refs.xxx 为VueComponent
refs 子组件加载正常; refs.xxx 为VueComponent
实际结果:
TypeError: Cannot read property 'selectAllComponents' of null
TypeError: Cannot read property 'selectAllComponents' of null
bug描述:
【报Bug】
ios hbuilderX 3.2.14
修改子包内容,热加载后 主包使用的refs ( this.$refs 在onReady nextTick 后调用) 获取为null 报错;
注: refs使用层级在二层;没有深层嵌套;
4 个回复
123qzo (作者)
refs 不在内置组件使用
DCloud_UNI_LXH
vue2还是vue3?具体是怎么使用的,贴一下看看。
yorker0503
的确有这个问题,我也遇到了,我是win10 ,HX3.2.12 , 热加载后,$refs就报 Cannot read property 'selectAllComponents' of null
不用热加载,重新编译就正常了
yorker0503
我用的vue2,代码如下: