mirror of
https://gitee.com/wot-design-uni/wot-design-uni.git
synced 2025-12-06 17:18:40 +08:00
fix: 🐛 修复PickerView在绑定值为0时无法生效的问题
This commit is contained in:
parent
2d94dd417c
commit
742b4d6525
@ -43,7 +43,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { getCurrentInstance, ref, watch, nextTick } from 'vue'
|
import { getCurrentInstance, ref, watch, nextTick } from 'vue'
|
||||||
import { deepClone, getType, isArray, isEqual, isFunction, range } from '../common/util'
|
import { deepClone, getType, isArray, isDef, isEqual, isFunction, range } from '../common/util'
|
||||||
import { formatArray, pickerViewProps, type PickerViewExpose } from './types'
|
import { formatArray, pickerViewProps, type PickerViewExpose } from './types'
|
||||||
|
|
||||||
const props = defineProps(pickerViewProps)
|
const props = defineProps(pickerViewProps)
|
||||||
@ -58,7 +58,7 @@ const preSelectedIndex = ref<Array<number>>([])
|
|||||||
watch(
|
watch(
|
||||||
() => props.modelValue,
|
() => props.modelValue,
|
||||||
(newValue, oldValue) => {
|
(newValue, oldValue) => {
|
||||||
if (!isEqual(oldValue, newValue) && newValue) {
|
if (!isEqual(oldValue, newValue) && isDef(newValue)) {
|
||||||
selectWithValue(newValue)
|
selectWithValue(newValue)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user