Skip to content

Commit a36ffd1

Browse files
author
rkrasnan
authored
Using forceNextTick
1 parent 1f1c725 commit a36ffd1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
import VueAnnouncer from './vue-announcer.vue'
2+
import VueForceNextTick from 'vue-force-next-tick'
23
import { OPTIONS } from './constants'
34

45
export default function install (Vue, options = {}, router = null) {
56
options = {...OPTIONS, ...options}
67

8+
Vue.use(VueForceNextTick);
79
Vue.component('VueAnnouncer', VueAnnouncer)
810
Vue.prototype.$announcer = {
911
set (message) {
1012
if (this.data) {
1113
this.data.content = ''
12-
Vue.nextTick()
13-
.then(() => {
14+
Vue.$forceNextTick(() => {
1415
this.data.content = message
1516
})
1617
}

0 commit comments

Comments
 (0)