feat(cascader): locale

This commit is contained in:
07akioni 2020-02-09 19:27:25 +08:00
parent 23b98c63b7
commit dbe13d311d
3 changed files with 15 additions and 4 deletions

View File

@ -22,7 +22,7 @@
:theme="synthesizedTheme"
:active="active"
:pattern="pattern"
:placeholder="placeholder"
:placeholder="localizedPlaceholder"
:selected-option="selectedOption"
:selected-options="selectedOptions"
:multiple="multiple"
@ -94,6 +94,7 @@ import { getType, traverseWithCallback } from './utils'
import asformitem from '../../../mixins/asformitem'
import NBasePortal from '../../../base/Portal'
import CascaderSelectMenu from './CascaderSelectMenu'
import locale from '../../../mixins/locale'
import {
rootedOptions,
@ -118,7 +119,7 @@ export default {
directives: {
clickoutside
},
mixins: [withapp, themeable, asformitem()],
mixins: [withapp, themeable, asformitem(), locale('Cascader')],
model: {
prop: 'value',
event: 'change'
@ -128,13 +129,13 @@ export default {
type: Array,
default: null
},
// eslint-disable-next-line vue/require-prop-types
value: {
type: [String, Number],
default: null
},
placeholder: {
type: String,
default: 'Please Select'
default: undefined
},
multiple: {
type: Boolean,
@ -202,6 +203,10 @@ export default {
},
computed: {
type: getType,
localizedPlaceholder () {
if (this.placeholder !== undefined) return this.placeholder
return this.localeNamespace.placeholder
},
enableAllOptions () {
return !this.leafOnly
},

View File

@ -3,6 +3,9 @@ export default {
positiveText: 'Confirm',
negativeText: 'Cancel'
},
Cascader: {
placeholder: 'Please Select'
},
DatePicker: {
Jan: 'Jan',
Feb: 'Feb',

View File

@ -3,6 +3,9 @@ export default {
positiveText: '确认',
negativeText: '取消'
},
Cascader: {
placeholder: '请选择'
},
DatePicker: {
Jan: '一月',
Feb: '二月',