[new feature] Picker: add default-index prop (#2935)

This commit is contained in:
neverland
2019-03-10 17:22:31 +08:00
committed by GitHub
parent cca584e9d5
commit cb72fef807
5 changed files with 101 additions and 42 deletions

View File

@@ -7,8 +7,12 @@
/>
</demo-block>
<demo-block :title="$t('title2')">
<van-picker :columns="$t('column2')" />
<demo-block :title="$t('defaultIndex')">
<van-picker
:columns="$t('column1')"
:default-index="2"
@change="onChange1"
/>
</demo-block>
<demo-block :title="$t('title3')">
@@ -21,6 +25,10 @@
/>
</demo-block>
<demo-block :title="$t('title2')">
<van-picker :columns="$t('column2')" />
</demo-block>
<demo-block :title="$t('title4')">
<van-picker
:columns="columns"
@@ -45,6 +53,7 @@ export default {
title2: '禁用选项',
title3: '展示顶部栏',
title4: '多列联动',
defaultIndex: '默认选中项',
column1: ['杭州', '宁波', '温州', '嘉兴', '湖州'],
column2: [
{ text: '杭州', disabled: true },
@@ -62,6 +71,7 @@ export default {
title2: 'Disable Option',
title3: 'Show Toolbar',
title4: 'Multi Columns',
defaultIndex: 'Default Index',
column1: ['Delaware', 'Florida', 'Georqia', 'Indiana', 'Maine'],
column2: [
{ text: 'Delaware', disabled: true },