Skip to content

Commit

Permalink
Merge pull request #146 from jujijigo/main
Browse files Browse the repository at this point in the history
修复crud组件搜索子组件DatePicker清除按钮未完全按预期工作的bug
  • Loading branch information
kanyxmo authored Apr 7, 2024
2 parents 3513c42 + a26b1d1 commit 0dd8525
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/components/ma-crud/components/searchFormItem/form-picker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,23 @@ const value = computed({
let val = get(searchForm.value, props.component.dataIndex)
if (val === undefined) {
if (props.component.formType === 'range') {
return props.component.searchDefaultValue ?? []
val = props.component.searchDefaultValue ?? []
} else {
return props.component.searchDefaultValue ?? ''
val = props.component.searchDefaultValue ?? ''
}
} else {
return val
}

return val
},
set(newVal) {
if (newVal === undefined) {
if (props.component.formType === 'range') {
newVal = []
} else {
newVal = ''
}
}

emit('update:modelValue', newVal)
set(searchForm.value, props.component.dataIndex, newVal)
}
Expand Down

0 comments on commit 0dd8525

Please sign in to comment.