mirror of
https://github.com/tenrok/vue2-datepicker.git
synced 2026-06-13 08:12:26 +03:00
feat: add prop defaultPanel (#394)
This commit is contained in:
@@ -139,6 +139,9 @@ export default {
|
||||
return date;
|
||||
},
|
||||
},
|
||||
defaultPanel: {
|
||||
type: String,
|
||||
},
|
||||
disabledDate: {
|
||||
type: Function,
|
||||
default: () => false,
|
||||
@@ -167,8 +170,9 @@ export default {
|
||||
},
|
||||
},
|
||||
data() {
|
||||
const panels = ['date', 'year', 'month'];
|
||||
const panel = panels.indexOf(this.type) !== -1 ? this.type : 'date';
|
||||
const panels = ['date', 'month', 'year'];
|
||||
const index = Math.max(panels.indexOf(this.type), panels.indexOf(this.defaultPanel));
|
||||
const panel = index !== -1 ? panels[index] : 'date';
|
||||
return {
|
||||
panel,
|
||||
innerCalendar: null,
|
||||
|
||||
Reference in New Issue
Block a user