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