/ Fixed toast card method
This commit is contained in:
@@ -12,8 +12,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import { defineComponent } from '@vue/composition-api'
|
import { defineComponent } from '@vue/composition-api'
|
||||||
|
|
||||||
import store from '@/store'
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'ToastCard',
|
name: 'ToastCard',
|
||||||
props: {
|
props: {
|
||||||
@@ -24,7 +22,8 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
closing: false
|
closing: false,
|
||||||
|
tickingRate: 900
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
@@ -38,17 +37,17 @@ export default defineComponent({
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
timeToLive = timeToLive - 1
|
timeToLive = timeToLive - 1
|
||||||
this.countdown(timeToLive)
|
this.countdown(timeToLive)
|
||||||
}, 900)
|
}, this.tickingRate)
|
||||||
} else {
|
} else {
|
||||||
// When timer ends
|
// When timer ends
|
||||||
this.closing = true
|
this.closing = true
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.close()
|
this.close()
|
||||||
}, 1200)
|
}, this.tickingRate)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
close () {
|
close () {
|
||||||
store.dispatch('toasts/purgeToast', this.toast.id)
|
this.$store.dispatch('toasts/purgeToast', this.toast.id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user