From 48a10261d772e5f8b0a3786ebbf40b6a9462d25e Mon Sep 17 00:00:00 2001 From: zhoulei Date: Thu, 16 Dec 2021 11:35:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=BB=84=E4=BB=B6jPicker=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E7=BC=93=E5=AD=98=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/J-Picker/jPicker.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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();