Cascader: add separator prop

pull/8507/head
Leopoldthecoder 2017-11-25 20:25:20 +08:00 committed by 杨奕
parent 6c4006487c
commit f307f7f428
3 changed files with 7 additions and 1 deletions

View File

@ -1669,6 +1669,7 @@ Search and select options with a keyword.
| options | data of the options | array | — | — | | options | data of the options | array | — | — |
| props | configuration options, see the following table | object | — | — | | props | configuration options, see the following table | object | — | — |
| value | selected value | array | — | — | | value | selected value | array | — | — |
| separator | option separator | string | — | / |
| popper-class | custom class name for Cascader's dropdown | string | — | — | | popper-class | custom class name for Cascader's dropdown | string | — | — |
| placeholder | input placeholder | string | — | Select | | placeholder | input placeholder | string | — | Select |
| disabled | whether Cascader is disabled | boolean | — | false | | disabled | whether Cascader is disabled | boolean | — | false |

View File

@ -1669,6 +1669,7 @@
| options | 可选项数据源,键名可通过 `props` 属性配置 | array | — | — | | options | 可选项数据源,键名可通过 `props` 属性配置 | array | — | — |
| props | 配置选项,具体见下表 | object | — | — | | props | 配置选项,具体见下表 | object | — | — |
| value | 选中项绑定值 | array | — | — | | value | 选中项绑定值 | array | — | — |
| separator | 选项分隔符 | string | — | 斜杠'/' |
| popper-class | 自定义浮层类名 | string | — | — | | popper-class | 自定义浮层类名 | string | — | — |
| placeholder | 输入框占位文本 | string | — | 请选择 | | placeholder | 输入框占位文本 | string | — | 请选择 |
| disabled | 是否禁用 | boolean | — | false | | disabled | 是否禁用 | boolean | — | false |

View File

@ -46,7 +46,7 @@
<template v-if="showAllLevels"> <template v-if="showAllLevels">
<template v-for="(label, index) in currentLabels"> <template v-for="(label, index) in currentLabels">
{{ label }} {{ label }}
<span v-if="index < currentLabels.length - 1"> / </span> <span v-if="index < currentLabels.length - 1"> {{ separator }} </span>
</template> </template>
</template> </template>
<template v-else> <template v-else>
@ -123,6 +123,10 @@ export default {
return []; return [];
} }
}, },
separator: {
type: String,
default: '/'
},
placeholder: { placeholder: {
type: String, type: String,
default() { default() {