Fixed "comment posted" snackbar bug AGAIN
Looks like setting the element's display style to none didn't work:
document.getElementById('snackbar').style.display = 'none'
Because on v-if, the element doesn't even exist in the HTML to be read! Changed it to v-show, and instead of accessing the element id, I used the data attribute `success` to toggle the display: none style for the snackbar. Also cleaned up the setTimeout function by having another function for toggling the `this.success` value.
setTimeout(this.hideSnackbar, 3000)
hideSnackbar() {
this.success = null
},
document.getElementById('snackbar').style.display = 'none'
Because on v-if, the element doesn't even exist in the HTML to be read! Changed it to v-show, and instead of accessing the element id, I used the data attribute `success` to toggle the display: none style for the snackbar. Also cleaned up the setTimeout function by having another function for toggling the `this.success` value.
setTimeout(this.hideSnackbar, 3000)
hideSnackbar() {
this.success = null
},