hookehuyr

fix 修复地址组件详细地址不填可能的问题

<!--
* @Date: 2023-03-29 15:27:02
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-06-17 14:47:21
* @LastEditTime: 2024-07-06 22:53:13
* @FilePath: /data-table/src/components/AreaPickerField/MyComponent.vue
* @Description: 文件描述
-->
......@@ -44,7 +44,7 @@ import { useCustomFieldValue } from '@vant/use';
// 获取父组件传值
const props = inject('props');
const show_address = ref(!props.component_props.no_street)
const show_address = ref(!props.component_props.no_street);
const address = ref(props.component_props.default?.input_value);
const city_code = ref(props.component_props.default?.city_code);
......@@ -62,7 +62,7 @@ const result_value = computed(() => {
address: fieldValue.value + ' ' + address.value,
city_code: city_code.value,
picker_value: fieldValue.value,
input_value: address.value
input_value: address.value,
}
})
......
<!--
* @Date: 2022-08-30 14:32:11
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-06-17 14:55:21
* @LastEditTime: 2024-07-06 22:51:15
* @FilePath: /data-table/src/components/AreaPickerField/index.vue
* @Description: 省市区选择控件
-->
......@@ -37,6 +37,12 @@ if (props.item.component_props.default) { // 存在默认值时业务逻辑
props.item.component_props.default.input_value = props.item.component_props.default.street;
props.item.city_code = props.item.component_props.default.city_code;
}
} else { // 默认值为空, 处理数据显示问题 - 详细地址不填写可能存在undefined
props.item.component_props.default = {
picker_value: '',
input_value: '',
city_code: '',
}
}
......