ManukMinasyan / vue-functional-calendar

Vue.js Functional Calendar | Component/Package
https://vue-functional-calendar.now.sh/
MIT License
473 stars 85 forks source link

Emit event when a day is clicked #53

Closed mewejo closed 4 years ago

mewejo commented 4 years ago

Thanks for the great work on this project! This simple PR will emit an event each time a day is clicked, allowing the parent component to do something, for example show a list of events on that day.

vercel[bot] commented 4 years ago

This pull request is being automatically deployed with ZEIT Now (learn more). To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/manukminasyan/vue-functional-calendar/n85qyvj4a ✅ Preview: https://vue-functional-calendar-git-fork-mewejo-patch-1.manukminasyan.now.sh

ManukMinasyan commented 4 years ago

Dear @mewejo for this we have the event "choseDay". Please follow this section.: https://github.com/ManukMinasyan/vue-functional-calendar#events

mewejo commented 4 years ago

Hi @ManukMinasyan - That only fires if date picked is enabled, else nothing happens. This allows to know when a date way clicked and handle it if required. Thank you for merging :)

ManukMinasyan commented 4 years ago

Hi @mewejo. Please follow this commit: https://github.com/ManukMinasyan/vue-functional-calendar/commit/b4fbafc3042dcf5a0d8cd3a3c3f8a651fd2e659c I think it will look better.

mewejo commented 4 years ago

I'd argue that dayClicked and choseDay are two different events though, and having both allows the user to decide on use case

ManukMinasyan commented 4 years ago

@mewejo OK I understand you now. Left both. And added to the event list: https://github.com/ManukMinasyan/vue-functional-calendar#events

Thank you.