I have a sporadic problem with Bootstrap Vue Modal.
I’m not that experienced with Vue and I’m not able to show the entire code because of my agreement with the project owner, also, it would be too much code to show anyway, so I’ll explain the issue. I’m hoping to get some hints to see what the issue can be because I’m out of ideas. So, here is the project info and issue I’m having:
I have created an event calendar.
The calendar shows month format and events are listed inside each day.
I stored year, month and day variable in the Vue instance data section.
I created a method that sets the calendar (setCalendar: function (year, month)).
I used “created” to setup the year, month and day as the current date when the page is loaded and vue is initialized and setCalendar.
I created Previous and Next buttons and next and previous functions which when clicked, the functions deducts (month--) or adds (month++) accordingly and sets the year, month and sets the calendar, (setCalendar).
I created <b-link v-b-modal="event.today_date + '-' + (index)"> and related modals <b-modal :id="event.today_date + '-' + (index)" :title="event.event_title"> for each <b-link>
When the page is initially loaded, the links to modals work perfectly, but for example, if I click on Previous button and load June calendar and events, and click on Next button to go back to July calendar and events, there will be one or two July <b-link> that links to June modals and the rest of <b-link> for July works fine. So, when I load June calendar and events and go back to July calendar and events, about 10% of July b-links, link to the June modals and of course when I click on those b-links, it does not load the modals because the modals do not exists in July calendar.
I can see this using Vue dev tools. When I click on a none working <b-link>, it links to a modal from the previous or next month. This is only affecting 10% of b-links and it only happens when I load the previous or next month calendar.
I appreciate if anyone can give me a clue as to what is causing this.
keys for the links and modals. Vue tries to be thrifty and re-use components by default when it can, it doesn't always make the decision you want. A key on the component will prevent that. - Bert