File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
src/uni_modules/wot-design-uni/components/wd-picker-view Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -57,10 +57,10 @@ const selectedIndex = ref<Array<number>>([]) // 格式化之后,每列选中
5757watch (
5858 [() => props .modelValue , () => props .columns ],
5959 (newValue , oldValue ) => {
60- if (! isEqual (oldValue [1 ], newValue [1 ])) {
60+ if (! isEqual (oldValue [1 ], newValue [1 ]) && isArray ( newValue [ 1 ]) && newValue [ 1 ]. length > 0 ) {
6161 formatColumns .value = formatArray (newValue [1 ], props .valueKey , props .labelKey )
6262 }
63- if (! isEqual ( oldValue [ 0 ], newValue [ 0 ]) && isDef (newValue [0 ])) {
63+ if (isDef (newValue [0 ])) {
6464 selectWithValue (newValue [0 ])
6565 }
6666 },
@@ -79,7 +79,6 @@ const { proxy } = getCurrentInstance() as any
7979 */
8080function selectWithValue(value : string | number | boolean | number [] | string [] | boolean []) {
8181 if (formatColumns .value .length === 0 ) return
82-
8382 // 使其默认选中首项
8483 if (value === ' ' || ! isDef (value ) || (isArray (value ) && value .length === 0 )) {
8584 value = formatColumns .value .map ((col ) => {
You can’t perform that action at this time.
0 commit comments