Using slider component with dynamic components?
OK so I want to create an infinite slider that shows days of the month. Its to be used in a diary of sorts so you start of in the current day and you can swipe left and right to navigate to the day you need.
Moment.jswould be used for date stuff.
Maybe I can use computed properties to dynamically change prev/next days/components depending on what is currently selected? Then check if I have anything stored for the
nextday and change accordingly?
@rstoenescu Do you have any idea if the Slider component would be able to handle this, or if this approach is any good at all. I think it should be able to handle dynamically adding and removing components.
I am planning to write a tutorial on this when I`m done with it because I couldn’t find anything on the subject.
Razvan is off for a week.
Someone else mentioned making an iOS-like selection for dates. I think that is what you are heading for too. This would require a new component or even set of components (one for day, month and year). The slider could be the start.
Oh no, not at all. I need a horizontal slider where you slide left and right for each day and that’s it. If you go to the 1st of April and go back it goes to the 31-st of March. I will probably try to implement something later and see if I manage.
Yeah, the sliding mechanism can be either horizontal or vertical. :smile: With a slider like functionality though, you are stuck to swiping one day at a time. Whereas, with the iOS selection wheel, you can “spin it”, which makes selection a better UX for date selection.