Showing
1 changed file
with
12 additions
and
9 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-08-30 14:32:11 | 2 | * @Date: 2022-08-30 14:32:11 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-06-17 14:46:43 | 4 | + * @LastEditTime: 2024-06-17 14:55:21 |
| 5 | * @FilePath: /data-table/src/components/AreaPickerField/index.vue | 5 | * @FilePath: /data-table/src/components/AreaPickerField/index.vue |
| 6 | * @Description: 省市区选择控件 | 6 | * @Description: 省市区选择控件 |
| 7 | --> | 7 | --> |
| ... | @@ -27,16 +27,19 @@ const props = defineProps({ | ... | @@ -27,16 +27,19 @@ const props = defineProps({ |
| 27 | item: Object, | 27 | item: Object, |
| 28 | }); | 28 | }); |
| 29 | 29 | ||
| 30 | -if (!props.item.component_props.default.city_code) { // 默认值为空 | 30 | +if (props.item.component_props.default) { // 存在默认值时业务逻辑 |
| 31 | - props.item.component_props.default.picker_value = ''; | 31 | + if (!props.item.component_props.default?.city_code) { // 默认值为空 |
| 32 | - props.item.component_props.default.input_value = ''; | 32 | + props.item.component_props.default.picker_value = ''; |
| 33 | - props.item.city_code = ''; | 33 | + props.item.component_props.default.input_value = ''; |
| 34 | -} else { | 34 | + props.item.city_code = ''; |
| 35 | - 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}`; | 35 | + } else { |
| 36 | - props.item.component_props.default.input_value = props.item.component_props.default.street; | 36 | + 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}`; |
| 37 | - props.item.city_code = props.item.component_props.default.city_code; | 37 | + props.item.component_props.default.input_value = props.item.component_props.default.street; |
| 38 | + props.item.city_code = props.item.component_props.default.city_code; | ||
| 39 | + } | ||
| 38 | } | 40 | } |
| 39 | 41 | ||
| 42 | + | ||
| 40 | // 注入子组件属性 | 43 | // 注入子组件属性 |
| 41 | provide('props', props.item); | 44 | provide('props', props.item); |
| 42 | // 隐藏显示 | 45 | // 隐藏显示 | ... | ... |
-
Please register or login to post a comment