0

There is this Vuetify alert set up:

<v-alert color="info" icon="storage" dismissible v-model="alert">
    {{ alertText }}
</v-alert>

And here's in the data:

data () {
  return {
    alert: localStorage.getItem('displayLsAlert') || true,
    (...)
}

I'm watching for changes of the alert (when user clicks on the "close" icon, the value changes to "false"):

watch: {
  alert: function () {
    localStorage.setItem('displayLsAlert', false)
  }
},

When closing the alert, an entry displayLsAlert appears in Local Storage, its value is false. So, it should not display the alert upon next visit, right? But it does. Whenever I come back to the page, the alert keeps on appearing.

Should the false value be wrapped or turned into different type?

AbreQueVoy
  • 1,748
  • 8
  • 31
  • 52

0 Answers0