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-09-06 16:10:18 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1303eee2682d8386d12c664b84cb05acc73c54e9
1303eee2
1 parent
8316f741
✨ feat: 地址输入模块新增详细地址录入功能
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
17 deletions
src/components/AreaPickerField/index.vue
src/views/index.vue
src/components/AreaPickerField/index.vue
View file @
1303eee
<!--
* @Date: 2022-08-30 14:32:11
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-0
8-30 17:56:04
* @LastEditTime: 2022-0
9-06 15:53:10
* @FilePath: /data-table/src/components/AreaPickerField/index.vue
* @Description: 文件描述
-->
...
...
@@ -10,8 +10,10 @@
<div class="label">{{ item.label }}<span v-if="item.required"> *</span></div>
<van-field v-model="item.value" is-link readonly :name="item.key" :required="item.required"
:placeholder="item.placeholder" :rules="item.rules" @click="showPicker = true" />
<van-field name="address" v-model="item.address" placeholder="详细地址" />
<van-popup v-model:show="showPicker" position="bottom">
<van-area v-model="item.code" title="" :area-list="areaList" @confirm="onConfirm" @cancel="showPicker = false" />
<van-area name="city_code" v-model="item.city_code" title="" :area-list="areaList" @confirm="onConfirm"
@cancel="showPicker = false" />
</van-popup>
</div>
</template>
...
...
@@ -21,7 +23,9 @@ import { areaList } from '@vant/area-data';
const props = defineProps({
item: Object
})
});
const address = ref('')
const showPicker = ref(false);
const fieldValue = ref('');
...
...
src/views/index.vue
View file @
1303eee
<!--
* @Date: 2022-07-18 10:22:22
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-09-06 15:
24:52
* @LastEditTime: 2022-09-06 15:
53:40
* @FilePath: /data-table/src/views/index.vue
* @Description: 首页
-->
...
...
@@ -55,17 +55,17 @@ onMounted(() => {
},
required: true,
},
{
key: 'email',
value: '',
label: '邮箱',
placeholder: '请输入邮箱',
component: '',
component_props: {
name: 'email'
},
required: true,
},
//
{
//
key: 'email',
//
value: '',
//
label: '邮箱',
//
placeholder: '请输入邮箱',
//
component: '',
//
component_props: {
//
name: 'email'
//
},
//
required: true,
//
},
// {
// key: 'age',
// value: '',
...
...
@@ -141,7 +141,8 @@ onMounted(() => {
key: 'city',
value: '天津市/天津市/和平区',
city_code: '120101',
label: '省市区',
label: '地址',
address: '',
placeholder: '请选择省市区',
component_props: {
name: 'area_picker'
...
...
@@ -176,7 +177,7 @@ onMounted(() => {
const onSubmit = (values) => {
console.log('submit', values);
//
console.warn(mockData.value);
console.warn(mockData.value);
};
</script>
...
...
Please
register
or
login
to post a comment