docs(TreeSelect): make document consistent with demo (#11136)

This commit is contained in:
neverland 2022-10-15 20:46:45 +08:00 committed by chenjiahan
parent f595d41b3b
commit 685351799e
5 changed files with 66 additions and 47 deletions

View File

@ -41,15 +41,18 @@ export default {
children: [
{ text: 'Delaware', id: 1 },
{ text: 'Florida', id: 2 },
{ text: 'Georqia', id: 3, disabled: true },
],
},
{
text: 'Group 2',
children: [
{ text: 'Alabama', id: 5 },
{ text: 'Kansas', id: 6 },
{ text: 'Alabama', id: 4 },
{ text: 'Kansas', id: 5 },
{ text: 'Louisiana', id: 6 },
],
},
{ text: 'Group 3', disabled: true },
];
return {
@ -84,15 +87,18 @@ export default {
children: [
{ text: 'Delaware', id: 1 },
{ text: 'Florida', id: 2 },
{ text: 'Georqia', id: 3, disabled: true },
],
},
{
text: 'Group 2',
children: [
{ text: 'Alabama', id: 5 },
{ text: 'Kansas', id: 6 },
{ text: 'Alabama', id: 4 },
{ text: 'Kansas', id: 5 },
{ text: 'Louisiana', id: 6 },
],
},
{ text: 'Group 3', disabled: true },
];
return {
@ -158,8 +164,24 @@ export default {
return {
activeIndex,
items: [
{ text: 'Group 1', children: [], dot: true },
{ text: 'Group 2', children: [], badge: 5 },
{
text: 'Group 1',
children: [
{ text: 'Delaware', id: 1 },
{ text: 'Florida', id: 2 },
{ text: 'Georqia', id: 3, disabled: true },
],
dot: true,
},
{
text: 'Group 2',
children: [
{ text: 'Alabama', id: 4 },
{ text: 'Kansas', id: 5 },
{ text: 'Louisiana', id: 6 },
],
badge: 5,
},
],
};
},

View File

@ -43,15 +43,18 @@ export default {
children: [
{ text: '杭州', id: 1 },
{ text: '温州', id: 2 },
{ text: '宁波', id: 3, disabled: true },
],
},
{
text: '江苏',
children: [
{ text: '南京', id: 5 },
{ text: '无锡', id: 6 },
{ text: '南京', id: 4 },
{ text: '无锡', id: 5 },
{ text: '徐州', id: 6 },
],
},
{ text: '福建', disabled: true },
];
return {
@ -88,15 +91,18 @@ export default {
children: [
{ text: '杭州', id: 1 },
{ text: '温州', id: 2 },
{ text: '宁波', id: 3, disabled: true },
],
},
{
text: '江苏',
children: [
{ text: '南京', id: 5 },
{ text: '无锡', id: 6 },
{ text: '南京', id: 4 },
{ text: '无锡', id: 5 },
{ text: '徐州', id: 6 },
],
},
{ text: '福建', disabled: true },
];
return {
@ -166,8 +172,24 @@ export default {
return {
activeIndex,
items: [
{ text: '浙江', children: [], dot: true },
{ text: '江苏', children: [], badge: 5 },
{
text: '浙江',
children: [
{ text: '杭州', id: 1 },
{ text: '温州', id: 2 },
{ text: '宁波', id: 3, disabled: true },
],
dot: true,
},
{
text: '江苏',
children: [
{ text: '南京', id: 4 },
{ text: '无锡', id: 5 },
{ text: '徐州', id: 6 },
],
badge: 5,
},
],
};
},

View File

@ -12,39 +12,31 @@ const group1 = [
id: 3,
disabled: true,
},
{
text: 'Indiana',
id: 4,
},
];
const group2 = [
{
text: 'Alabama',
id: 5,
id: 4,
},
{
text: 'Kansas',
id: 6,
id: 5,
},
{
text: 'Louisiana',
id: 7,
},
{
text: 'Texas',
id: 8,
id: 6,
},
];
const group3 = [
{
text: 'Alabama',
id: 9,
id: 7,
},
{
text: 'Kansas',
id: 10,
id: 8,
},
];

View File

@ -12,39 +12,31 @@ const zhejiang = [
id: 3,
disabled: true,
},
{
text: '义乌',
id: 4,
},
];
const jiangsu = [
{
text: '南京',
id: 5,
id: 4,
},
{
text: '无锡',
id: 6,
id: 5,
},
{
text: '徐州',
id: 7,
},
{
text: '苏州',
id: 8,
id: 6,
},
];
const fujian = [
{
text: '泉州',
id: 9,
id: 7,
},
{
text: '厦门',
id: 10,
id: 8,
},
];

View File

@ -47,9 +47,6 @@ exports[`should render demo and match snapshot 1`] = `
<div class="van-ellipsis van-tree-select__item van-tree-select__item--disabled">
Georqia
</div>
<div class="van-ellipsis van-tree-select__item">
Indiana
</div>
</div>
</div>
</div>
@ -101,9 +98,6 @@ exports[`should render demo and match snapshot 1`] = `
<div class="van-ellipsis van-tree-select__item van-tree-select__item--disabled">
Georqia
</div>
<div class="van-ellipsis van-tree-select__item">
Indiana
</div>
</div>
</div>
</div>
@ -185,9 +179,6 @@ exports[`should render demo and match snapshot 1`] = `
<div class="van-ellipsis van-tree-select__item van-tree-select__item--disabled">
Georqia
</div>
<div class="van-ellipsis van-tree-select__item">
Indiana
</div>
</div>
</div>
</div>