Showing
2 changed files
with
8 additions
and
5 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: 2022-12-08 14:57:16 | 4 | + * @LastEditTime: 2022-12-29 15:42:46 |
| 5 | * @FilePath: /data-table/src/components/AreaPickerField/index.vue | 5 | * @FilePath: /data-table/src/components/AreaPickerField/index.vue |
| 6 | * @Description: 省市区选择控件 | 6 | * @Description: 省市区选择控件 |
| 7 | --> | 7 | --> |
| 8 | <template> | 8 | <template> |
| 9 | - <div class="area-picker-field"> | 9 | + <div v-if="HideShow" class="area-picker-field"> |
| 10 | <div class="label">{{ item.component_props.label }}<span v-if="item.component_props.required"> *</span></div> | 10 | <div class="label">{{ item.component_props.label }}<span v-if="item.component_props.required"> *</span></div> |
| 11 | <van-field | 11 | <van-field |
| 12 | name="ignore" | 12 | name="ignore" |
| ... | @@ -22,7 +22,7 @@ | ... | @@ -22,7 +22,7 @@ |
| 22 | <van-field | 22 | <van-field |
| 23 | name="ignore" | 23 | name="ignore" |
| 24 | v-model="address" | 24 | v-model="address" |
| 25 | - :placeholder="item.component_props.placeholder" | 25 | + placeholder="请填写详细地址" |
| 26 | @blur="onBlur" | 26 | @blur="onBlur" |
| 27 | :rules="item.rules" | 27 | :rules="item.rules" |
| 28 | :border="false" | 28 | :border="false" |
| ... | @@ -54,7 +54,10 @@ import { areaList } from "@vant/area-data"; | ... | @@ -54,7 +54,10 @@ import { areaList } from "@vant/area-data"; |
| 54 | const props = defineProps({ | 54 | const props = defineProps({ |
| 55 | item: Object, | 55 | item: Object, |
| 56 | }); | 56 | }); |
| 57 | - | 57 | +// 隐藏显示 |
| 58 | +const HideShow = computed(() => { | ||
| 59 | + return !props.item.component_props.disabled | ||
| 60 | +}) | ||
| 58 | const emit = defineEmits(["active"]); | 61 | const emit = defineEmits(["active"]); |
| 59 | const show_empty = ref(false); | 62 | const show_empty = ref(false); |
| 60 | 63 | ... | ... |
| ... | @@ -85,7 +85,7 @@ export function createComponentType(data) { | ... | @@ -85,7 +85,7 @@ export function createComponentType(data) { |
| 85 | if (item.component_props.tag === 'select') { | 85 | if (item.component_props.tag === 'select') { |
| 86 | item.component = PickerField; | 86 | item.component = PickerField; |
| 87 | } | 87 | } |
| 88 | - if (item.component_props.tag === 'area_picker') { | 88 | + if (item.component_props.tag === 'address') { |
| 89 | item.component = AreaPickerField; | 89 | item.component = AreaPickerField; |
| 90 | } | 90 | } |
| 91 | if (item.component_props.tag === 'date') { | 91 | if (item.component_props.tag === 'date') { | ... | ... |
-
Please register or login to post a comment