mirror of
https://github.com/tenrok/vue2-datepicker.git
synced 2026-06-21 12:30:35 +03:00
feat: add event update:show-time-panel (#531)
This commit is contained in:
+5
-3
@@ -482,9 +482,11 @@ export default {
|
|||||||
...pick(this.$props, Object.keys(Component.props)),
|
...pick(this.$props, Object.keys(Component.props)),
|
||||||
value: this.currentValue,
|
value: this.currentValue,
|
||||||
};
|
};
|
||||||
const content = (
|
const on = {
|
||||||
<Component {...{ props, on: { select: this.handleSelectDate }, ref: 'picker' }} />
|
...pick(this.$listeners, Component.emits || []),
|
||||||
);
|
select: this.handleSelectDate,
|
||||||
|
};
|
||||||
|
const content = <Component {...{ props, on, ref: 'picker' }} />;
|
||||||
return (
|
return (
|
||||||
<div class={`${this.prefixClass}-datepicker-body`}>
|
<div class={`${this.prefixClass}-datepicker-body`}>
|
||||||
{this.renderSlot('content', content, {
|
{this.renderSlot('content', content, {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export default {
|
|||||||
default: 'mx',
|
default: 'mx',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
emits: ['select', 'update:show-time-panel'],
|
||||||
props: {
|
props: {
|
||||||
...CalendarPanel.props,
|
...CalendarPanel.props,
|
||||||
...TimePanel.props,
|
...TimePanel.props,
|
||||||
@@ -33,6 +34,9 @@ export default {
|
|||||||
value(val) {
|
value(val) {
|
||||||
this.currentValue = val;
|
this.currentValue = val;
|
||||||
},
|
},
|
||||||
|
defaultTimeVisible(val) {
|
||||||
|
this.$emit('update:show-time-panel', val);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
closeTimePanel() {
|
closeTimePanel() {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export default {
|
|||||||
default: 'mx',
|
default: 'mx',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
emits: ['select', 'update:show-time-panel'],
|
||||||
props: {
|
props: {
|
||||||
...CalendarRange.props,
|
...CalendarRange.props,
|
||||||
...TimeRange.props,
|
...TimeRange.props,
|
||||||
@@ -33,6 +34,9 @@ export default {
|
|||||||
value(val) {
|
value(val) {
|
||||||
this.currentValue = val;
|
this.currentValue = val;
|
||||||
},
|
},
|
||||||
|
defaultTimeVisible(val) {
|
||||||
|
this.$emit('update:show-time-panel', val);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
closeTimePanel() {
|
closeTimePanel() {
|
||||||
|
|||||||
Reference in New Issue
Block a user