mirror of
https://github.com/tenrok/vue2-datepicker.git
synced 2026-06-11 13:12:26 +03:00
添加range-separator
This commit is contained in:
@@ -52,9 +52,11 @@ export default {
|
||||
|---------------------|---------------|-------------|-----------------------------------------------------|
|
||||
| type | String | 'date' | select datepicker or datetimepicker(date/datetime) |
|
||||
| range | Boolean | false | if true, the type is daterange or datetimerange |
|
||||
| confirm | Boolean | false | if true, need click the button to change the value |
|
||||
| format | String | yyyy-MM-dd | Date formatting string |
|
||||
| lang | String/Object | zh | Translation (en/zh/es/pt-br/fr/ru/de/it/cs)(custom) |
|
||||
| confirm | Boolean | false | if true, need click the button to change the value |
|
||||
| disabled | Boolean | false | Disable the component |
|
||||
| editable | Boolean | false | if true, user can type it(only the range is false) |
|
||||
| placeholder | String | | input placeholder text |
|
||||
| width | String/Number | 210 | input size |
|
||||
| disabled-days | Array | [] | Days in YYYY-MM-DD format to disable |
|
||||
@@ -66,8 +68,8 @@ export default {
|
||||
| first-day-of-week | Number | 7 | set the first day of week (1-7) |
|
||||
| input-class | String | 'mx-input' | the input class name |
|
||||
| confirm-text | String | 'OK' | the default text to display on confirm button |
|
||||
| disabled | Boolean | false | Disable the component |
|
||||
| editable | Boolean | false | if true, user can type it(only the range is false) |
|
||||
| range-separator | String | '~' | the range separator text |
|
||||
|
||||
|
||||
#### lang
|
||||
* String (en/zh/es/pt-br/fr/ru/de/it/cs)
|
||||
|
||||
@@ -144,6 +144,10 @@ export default {
|
||||
editable: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
rangeSeparator: {
|
||||
type: String,
|
||||
default: '~'
|
||||
}
|
||||
},
|
||||
data () {
|
||||
@@ -198,7 +202,7 @@ export default {
|
||||
}
|
||||
if (this.range && this.isValidRange(this.value)) {
|
||||
return (
|
||||
this.stringify(this.value[0]) + ' ~ ' + this.stringify(this.value[1])
|
||||
this.stringify(this.value[0]) + ` ${this.rangeSeparator} ` + this.stringify(this.value[1])
|
||||
)
|
||||
}
|
||||
return ''
|
||||
|
||||
Reference in New Issue
Block a user