0👍
Solved it with the following. Oddly enough localStorage removeItem
wasn’t removing the item if it’s a bool, just sets it to false. So checked against that in the created hook. Slightly dirty:
if (localStorage.getItem('savedClosedTickets') === "true"){
// render closed tickets
} else if (localStorage.getItem('savedClosedTickets') === "false"){
// render open tickets
} else {
// falls here on initial load (no pairs set), so render open tickets
}
And in the method for showing closed tickets, if toggle isn’t enabled (clicked, checked, etc), then removeItem:
localStorage.removeItem('savedClosedTickets');
- [Vuejs]-How to manually trigger routing on nuxt.js?
- [Vuejs]-How to display a success alert with vuetify after successfully inserting data into database
Source:stackexchange.com