Skip to content

Commit ef1eed8

Browse files
authored
Merge pull request #14 from rkrasnan/master
Vue Force Next Tick
2 parents 1f1c725 + 4a6ce7a commit ef1eed8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"standard-version": "^4.3.0",
6464
"surge": "^0.21.3",
6565
"vue": "^2.5.16",
66+
"vue-force-next-tick" : "^1.0.3",
6667
"vue-template-compiler": "^2.5.16"
6768
}
6869
}

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)