Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can i intercept payload from the Select event #459

Closed
makowy opened this issue Apr 17, 2020 · 3 comments
Closed

How can i intercept payload from the Select event #459

makowy opened this issue Apr 17, 2020 · 3 comments

Comments

@makowy
Copy link

makowy commented Apr 17, 2020

Hi,
I need to receive date from select. Now it works that select push data into DatePicker, but i need to receive this data straight in my app.
I see that the event is emitted whenever a field is selected. The question is how could I get this payload? Because i want to output picked date(year,month,day) step by step.
Select-year and select-month were great solutions, but they were removed.

@calendar-change does not help me, because it also works after pressing the arrow.

you are doing a good job, thanks

image

@mengxiong10
Copy link
Owner

mengxiong10 commented Apr 20, 2020

I think I can add an argument for calendar-change.
type: 'year' | 'month' | 'last-year' | 'next-year' | 'last-month' | 'next-month' | 'last-decade' | 'next-decade'

<date-picker  @calendar-change="handleCalendarChange" />
handleCalendarChange(value, oldValue, type) {
 if (type === 'year') { // when select year }
 if (type === 'month') { // when select month }
}

@makowy
Copy link
Author

makowy commented Apr 20, 2020

this solution would be very helpful, thank you

@mengxiong10
Copy link
Owner

v3.5.0 added it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants