[Vuejs]-How do I make an alert that I can dismiss forever in BootstrapVue?

0👍

Yes as you said, localStorage is perfectly fine to use it for this case.

Just bare in mind, that localStorage is only stored in the current device that user is using. For example, if the user uses mobile and checks your announcement then the announcement will not be visible in mobile, but if user opens other device(laptop, etc..) then the announcement will pop up again.

In case you want always to know for all devices (for each user account) then this should be saved in a database and through an api endpoint to get this information and know when to show the announcement.

Add item in localstorage:

localStorage.setItem('YourItem', response.data)

You can fetch this using:

localStorage.getItem('YourItem')

To delete this from localStorage:

localStorage.removeItem('YourItem')

Leave a comment