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
2022-12-29 15:45:56 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c1b95a6b832ee63eb65d83e4fbd8cba13778d1a0
c1b95a6b
1 parent
cf4f0c12
地址控件联调
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
src/components/AreaPickerField/index.vue
src/hooks/useComponentType.js
src/components/AreaPickerField/index.vue
View file @
c1b95a6
<!--
* @Date: 2022-08-30 14:32:11
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-12-
08 14:57:1
6
* @LastEditTime: 2022-12-
29 15:42:4
6
* @FilePath: /data-table/src/components/AreaPickerField/index.vue
* @Description: 省市区选择控件
-->
<template>
<div class="area-picker-field">
<div
v-if="HideShow"
class="area-picker-field">
<div class="label">{{ item.component_props.label }}<span v-if="item.component_props.required"> *</span></div>
<van-field
name="ignore"
...
...
@@ -22,7 +22,7 @@
<van-field
name="ignore"
v-model="address"
:placeholder="item.component_props.placeholder
"
placeholder="请填写详细地址
"
@blur="onBlur"
:rules="item.rules"
:border="false"
...
...
@@ -54,7 +54,10 @@ import { areaList } from "@vant/area-data";
const props = defineProps({
item: Object,
});
// 隐藏显示
const HideShow = computed(() => {
return !props.item.component_props.disabled
})
const emit = defineEmits(["active"]);
const show_empty = ref(false);
...
...
src/hooks/useComponentType.js
View file @
c1b95a6
...
...
@@ -85,7 +85,7 @@ export function createComponentType(data) {
if
(
item
.
component_props
.
tag
===
'select'
)
{
item
.
component
=
PickerField
;
}
if
(
item
.
component_props
.
tag
===
'a
rea_picker
'
)
{
if
(
item
.
component_props
.
tag
===
'a
ddress
'
)
{
item
.
component
=
AreaPickerField
;
}
if
(
item
.
component_props
.
tag
===
'date'
)
{
...
...
Please
register
or
login
to post a comment