hookehuyr

fix 处理地址选择组件默认值为空时显示问题

<!--
* @Date: 2023-03-29 15:27:02
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-06-13 17:13:29
* @LastEditTime: 2024-06-17 14:47:21
* @FilePath: /data-table/src/components/AreaPickerField/MyComponent.vue
* @Description: 文件描述
-->
......
<!--
* @Date: 2022-08-30 14:32:11
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-06-13 17:06:42
* @LastEditTime: 2024-06-17 14:46:43
* @FilePath: /data-table/src/components/AreaPickerField/index.vue
* @Description: 省市区选择控件
-->
......@@ -21,12 +21,17 @@
<script setup>
import MyComponent from './MyComponent.vue';
import _ from 'lodash'
const props = defineProps({
item: Object,
});
if (props.item.component_props.default) {
if (!props.item.component_props.default.city_code) { // 默认值为空
props.item.component_props.default.picker_value = '';
props.item.component_props.default.input_value = '';
props.item.city_code = '';
} else {
props.item.component_props.default.picker_value = `${props.item.component_props.default.province} ${props.item.component_props.default.city} ${props.item.component_props.default.district}`;
props.item.component_props.default.input_value = props.item.component_props.default.street;
props.item.city_code = props.item.component_props.default.city_code;
......