0👍
In your notification component add v-if
and close button with hide
function
<div class="ui message" :class="type" v-if="!hidden">
<i class="close icon" @click="hide"></i>
<div class="header">
{{header}}
</div>
<slot></slot>
</div>
...
data() {
return {
hidden: false
}
},
methods: {
hide() {
this.hidden = true
}
}
But If message is automatically closed (with some delay), then you should destroy component and emit changes in parent.
- [Vuejs]-How to correctly reorder array when using computed properties with SortableJS and Vue?
- [Vuejs]-Vue dynamic component template not working for promise
Source:stackexchange.com