Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
data-table
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2024-06-17 14:59:32 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a415f146a358ef6ab639e7464a0890cddb790b9c
a415f146
1 parent
d74e2fdf
fix 地址选择组件,存在默认值时业务逻辑优化
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
src/components/AreaPickerField/index.vue
src/components/AreaPickerField/index.vue
View file @
a415f14
<!--
* @Date: 2022-08-30 14:32:11
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-06-17 14:
46:43
* @LastEditTime: 2024-06-17 14:
55:21
* @FilePath: /data-table/src/components/AreaPickerField/index.vue
* @Description: 省市区选择控件
-->
...
...
@@ -27,16 +27,19 @@ const props = defineProps({
item: Object,
});
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;
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;
}
}
// 注入子组件属性
provide('props', props.item);
// 隐藏显示
...
...
Please
register
or
login
to post a comment