feat(Cascader): basic dom struct

This commit is contained in:
chenjiahan
2020-12-20 21:23:50 +08:00
committed by neverland
parent 8180478213
commit 0352f5d9a6
7 changed files with 236 additions and 55 deletions
+122
View File
@@ -0,0 +1,122 @@
export default [
{
text: '浙江省',
value: '330000',
children: [
{
text: '杭州市',
value: '330100',
children: [
{
text: '上城区',
value: '330102',
},
{
text: '下城区',
value: '330103',
},
{
text: '江干区',
value: '330104',
},
],
},
{
text: '宁波市',
value: '330200',
children: [
{
text: '海曙区',
value: '330203',
},
{
text: '江北区',
value: '330205',
},
{
text: '北仑区',
value: '330206',
},
],
},
{
text: '温州市',
value: '330300',
children: [
{
text: '鹿城区',
value: '330302',
},
{
text: '龙湾区',
value: '330303',
},
{
text: '瓯海区',
value: '330304',
},
],
},
],
},
{
text: '江苏省',
value: '320000',
children: [
{
text: '南京市',
value: '320100',
children: [
{
text: '玄武区',
value: '320102',
},
{
text: '秦淮区',
value: '320104',
},
{
text: '建邺区',
value: '320105',
},
],
},
{
text: '无锡市',
value: '320200',
children: [
{
text: '锡山区',
value: '320205',
},
{
text: '惠山区',
value: '320206',
},
{
text: '滨湖区',
value: '320211',
},
],
},
{
text: '徐州市',
value: '320300',
children: [
{
text: '鼓楼区',
value: '320302',
},
{
text: '云龙区',
value: '320303',
},
{
text: '贾汪区',
value: '320305',
},
],
},
],
},
];
+7 -2
View File
@@ -1,6 +1,6 @@
<template>
<demo-section>
<demo-block :title="t('basicUsage')">
<demo-block card :title="t('basicUsage')">
<van-field
is-link
readonly
@@ -8,17 +8,22 @@
:placeholder="t('selectArea')"
@click="showBase = true"
/>
<van-cascader :show.sync="showBase" :title="t('selectArea')" />
<van-popup v-model="showBase" round position="bottom">
<van-cascader :title="t('selectArea')" :options="t('options')" />
</van-popup>
</demo-block>
</demo-section>
</template>
<script>
import zhCNOptions from './area';
export default {
i18n: {
'zh-CN': {
area: '地区',
selectArea: '请选择地区',
options: zhCNOptions,
},
'en-US': {
area: 'Area',