diff --git a/src/components/J-Picker/jPicker.vue b/src/components/J-Picker/jPicker.vue index 947f94e..147e157 100644 --- a/src/components/J-Picker/jPicker.vue +++ b/src/components/J-Picker/jPicker.vue @@ -79,6 +79,18 @@ export default { this.selByValKey(); }, }, + // 原始bug + // uniapp 无法监听prop对象,使用computed替代方案解决组件缓存问题 + reset(v) { + if (v === '' || v === undefined || v === null) { + this.nSel = -1; + } + }, + }, + computed: { + reset() { + return this.val; + }, }, mounted() { this.selByValKey();