init DatePicker
init DatePicker
This commit is contained in:
parent
46d4f3b314
commit
17e1fcf151
11 changed files with 111 additions and 5 deletions
23
src/components/date-picker/picker/date-picker.js
Normal file
23
src/components/date-picker/picker/date-picker.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
import Picker from '../picker.vue';
|
||||
import DatePanel from '../panel/date.vue';
|
||||
import DateRangePanel from '../panel/date-range.vue';
|
||||
|
||||
const getPanel = function (type) {
|
||||
if (type === 'daterange' || type === 'datetimerange') {
|
||||
return DateRangePanel;
|
||||
}
|
||||
return DatePanel;
|
||||
};
|
||||
|
||||
export default {
|
||||
mixins: [Picker],
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
default: 'date'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.panel = getPanel(this.type);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue