diff --git a/packages/vant/src/tree-select/README.md b/packages/vant/src/tree-select/README.md index 8e6cea5ee..3574fad3f 100644 --- a/packages/vant/src/tree-select/README.md +++ b/packages/vant/src/tree-select/README.md @@ -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, + }, ], }; }, diff --git a/packages/vant/src/tree-select/README.zh-CN.md b/packages/vant/src/tree-select/README.zh-CN.md index 01e02f4aa..efe366785 100644 --- a/packages/vant/src/tree-select/README.zh-CN.md +++ b/packages/vant/src/tree-select/README.zh-CN.md @@ -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, + }, ], }; }, diff --git a/packages/vant/src/tree-select/demo/data-en.ts b/packages/vant/src/tree-select/demo/data-en.ts index 57d93f4e0..4affb9508 100644 --- a/packages/vant/src/tree-select/demo/data-en.ts +++ b/packages/vant/src/tree-select/demo/data-en.ts @@ -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, }, ]; diff --git a/packages/vant/src/tree-select/demo/data-zh.ts b/packages/vant/src/tree-select/demo/data-zh.ts index 04096a180..5960adc5e 100644 --- a/packages/vant/src/tree-select/demo/data-zh.ts +++ b/packages/vant/src/tree-select/demo/data-zh.ts @@ -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, }, ]; diff --git a/packages/vant/src/tree-select/test/__snapshots__/demo.spec.ts.snap b/packages/vant/src/tree-select/test/__snapshots__/demo.spec.ts.snap index 92a5a41af..008495ea4 100644 --- a/packages/vant/src/tree-select/test/__snapshots__/demo.spec.ts.snap +++ b/packages/vant/src/tree-select/test/__snapshots__/demo.spec.ts.snap @@ -47,9 +47,6 @@ exports[`should render demo and match snapshot 1`] = `