mengxiong10 / vue-datepicker-next

A datepicker / datetimepicker component for Vue3
https://mengxiong10.github.io/vue-datepicker-next/
MIT License
147 stars 34 forks source link

[Question] Is there any way to imperatively close picker? #35

Closed jinyongp closed 1 year ago

jinyongp commented 1 year ago

Vue-datepicker-next version: 1.0.2 Vue version: 3.2.45 Browser: Chrome (110.0.5481.100)

I found an issue(https://github.com/mengxiong10/vue2-datepicker/issues/351) related to this problem, but I think the "closePopup" function disappeared. Is there any other way?

mengxiong10 commented 1 year ago

You can use prop open.

<date-picker :open="open" @open="handleOpen" @close="handleClose" />
data() {
    return { open: false }
},
methods: {
  handleOpen() { this.open = true },
  handleClose() { this.open = false }
}
jinyongp commented 1 year ago

It works well, thanks!