Skip to content

Commit 742b4d6

Browse files
author
xuqingkai
committed
fix: 🐛 修复PickerView在绑定值为0时无法生效的问题
1 parent 2d94dd4 commit 742b4d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/uni_modules/wot-design-uni/components/wd-picker-view/wd-picker-view.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default {
4343
</script>
4444
<script lang="ts" setup>
4545
import { getCurrentInstance, ref, watch, nextTick } from 'vue'
46-
import { deepClone, getType, isArray, isEqual, isFunction, range } from '../common/util'
46+
import { deepClone, getType, isArray, isDef, isEqual, isFunction, range } from '../common/util'
4747
import { formatArray, pickerViewProps, type PickerViewExpose } from './types'
4848
4949
const props = defineProps(pickerViewProps)
@@ -58,7 +58,7 @@ const preSelectedIndex = ref<Array<number>>([])
5858
watch(
5959
() => props.modelValue,
6060
(newValue, oldValue) => {
61-
if (!isEqual(oldValue, newValue) && newValue) {
61+
if (!isEqual(oldValue, newValue) && isDef(newValue)) {
6262
selectWithValue(newValue)
6363
}
6464
},

0 commit comments

Comments
 (0)