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-13 17:14:12 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ab84c1b32c800b26ed6bf7d0745609574b5f03b5
ab84c1b3
1 parent
77594694
fix 地址组件处理默认值显示问题
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
src/components/AreaPickerField/MyComponent.vue
src/components/AreaPickerField/index.vue
src/components/AreaPickerField/MyComponent.vue
View file @
ab84c1b
<!--
* @Date: 2023-03-29 15:27:02
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-06-
06 16:01:31
* @LastEditTime: 2024-06-
13 17:13:29
* @FilePath: /data-table/src/components/AreaPickerField/MyComponent.vue
* @Description: 文件描述
-->
...
...
@@ -46,10 +46,10 @@ import { useCustomFieldValue } from '@vant/use';
const props = inject('props');
const show_address = ref(!props.component_props.no_street)
const address = ref(props.component_props.default.input_value);
const city_code = ref(
""
);
const address = ref(props.component_props.default
?
.input_value);
const city_code = ref(
props.component_props.default?.city_code
);
const showPicker = ref(false);
let fieldValue = ref(props.component_props.default.picker_value);
let fieldValue = ref(props.component_props.default
?
.picker_value);
const onClick = () => {
if (!props.component_props.readonly) { // 非只读状态下可以点击弹出
...
...
src/components/AreaPickerField/index.vue
View file @
ab84c1b
<!--
* @Date: 2022-08-30 14:32:11
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 202
3-03-29 16:18:53
* @LastEditTime: 202
4-06-13 17:06:42
* @FilePath: /data-table/src/components/AreaPickerField/index.vue
* @Description: 省市区选择控件
-->
...
...
@@ -25,12 +25,19 @@ import MyComponent from './MyComponent.vue';
const props = defineProps({
item: Object,
});
if (props.item.component_props.default) {
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);
// 隐藏显示
const HideShow = computed(() => {
return !props.item.component_props.disabled
})
})
;
// 规则校验
const required = props.item.component_props.required;
...
...
Please
register
or
login
to post a comment