abichinger / vue-js-cron

Renderless Vue.js cron editor
MIT License
67 stars 23 forks source link

Get selected period for storage and than use in initialPeriod prop #47

Closed yatkolenko closed 6 months ago

yatkolenko commented 6 months ago

Hello, is there any way to retrieve the selected period?

For example, I selected the period day, selected the values, then saved. When I reload the page, it opens with the maximum period, not as it was when I saved, it was a day.

I see an initialPeriod property in the documentation, so if it were possible to get the selected period, I could save it next to the cron value and then put that saved value into the initialPeriod property when I reopen the page.

Thanks!

abichinger commented 6 months ago

Hello!

Unfortunately this is not possible at the moment. I'm going to add an event named update:period, which is fired every time the period is changed.

abichinger commented 6 months ago

You can now use v-model:period="savedPeriod" to create a two-way binding.

yatkolenko commented 6 months ago

Thank you!!