2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-05-30 11:54:06 +03:00

feat: add event update:show-time-panel (#531)

This commit is contained in:
mengxiong10
2020-11-16 16:34:21 +08:00
parent a5a41096dc
commit 45969a1480
3 changed files with 13 additions and 3 deletions
+5 -3
View File
@@ -482,9 +482,11 @@ export default {
...pick(this.$props, Object.keys(Component.props)),
value: this.currentValue,
};
const content = (
<Component {...{ props, on: { select: this.handleSelectDate }, ref: 'picker' }} />
);
const on = {
...pick(this.$listeners, Component.emits || []),
select: this.handleSelectDate,
};
const content = <Component {...{ props, on, ref: 'picker' }} />;
return (
<div class={`${this.prefixClass}-datepicker-body`}>
{this.renderSlot('content', content, {
+4
View File
@@ -10,6 +10,7 @@ export default {
default: 'mx',
},
},
emits: ['select', 'update:show-time-panel'],
props: {
...CalendarPanel.props,
...TimePanel.props,
@@ -33,6 +34,9 @@ export default {
value(val) {
this.currentValue = val;
},
defaultTimeVisible(val) {
this.$emit('update:show-time-panel', val);
},
},
methods: {
closeTimePanel() {
+4
View File
@@ -10,6 +10,7 @@ export default {
default: 'mx',
},
},
emits: ['select', 'update:show-time-panel'],
props: {
...CalendarRange.props,
...TimeRange.props,
@@ -33,6 +34,9 @@ export default {
value(val) {
this.currentValue = val;
},
defaultTimeVisible(val) {
this.$emit('update:show-time-panel', val);
},
},
methods: {
closeTimePanel() {