update DatePicker
update DatePicker
This commit is contained in:
parent
344131a7af
commit
13be443453
4 changed files with 14 additions and 6 deletions
|
@ -11,7 +11,10 @@
|
|||
props: {
|
||||
date: {},
|
||||
year: {},
|
||||
disabledDate: {}
|
||||
disabledDate: {},
|
||||
selectionMode: {
|
||||
default: 'year'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
classes () {
|
||||
|
@ -37,7 +40,7 @@
|
|||
|
||||
const date = new Date(this.date);
|
||||
date.setFullYear(cell.text);
|
||||
cell.disabled = typeof this.disabledDate === 'function' && this.disabledDate(date);
|
||||
cell.disabled = typeof this.disabledDate === 'function' && this.disabledDate(date) && this.selectionMode === 'year';
|
||||
|
||||
cell.selected = Number(this.year) === cell.text;
|
||||
cells.push(cell);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue