Skip to content

Commit

Permalink
Merge pull request #180 from tiancheng-66/patch-2
Browse files Browse the repository at this point in the history
Update form-input.vue
  • Loading branch information
kanyxmo authored Jun 17, 2024
2 parents 23ebba0 + 5fe71a6 commit a17aec6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const props = defineProps({
const searchForm = inject('searchForm')
const minData = ref(isArray(props.component?.searchDefaultValue) ? props.component?.searchDefaultValue[0] : undefined)
const maxData = ref(isArray(props.component?.searchDefaultValue) ? props.component?.searchDefaultValue[1] : undefined)
const value = ref(get(searchForm.value, props.component.dataIndex, props.component.searchDefaultValue ?? ''))
const value = ref(get(searchForm.value, props.component.dataIndex, props.component.searchDefaultValue ?? props.component.formType === 'input-number' ? 0 : ''))

if (props.component.formType === 'input-number' && (props.component?.rangeSearch ?? false)) {
set(searchForm.value, `${props.component.dataIndex}Min`, minData.value)
Expand All @@ -61,4 +61,4 @@ watch( () => get(searchForm.value, props.component.dataIndex), vl => value.value
watch( () => value.value, v => set(searchForm.value, props.component.dataIndex, v) )
watch( () => minData.value, v => set(searchForm.value, `${props.component.dataIndex}Min`, v) )
watch( () => maxData.value, v => set(searchForm.value, `${props.component.dataIndex}Max`, v) )
</script>
</script>

0 comments on commit a17aec6

Please sign in to comment.