Skip to content

Commit 6731444

Browse files
ayamflowFlorian Morel
authored and
Florian Morel
committed
Allow Vue.nextTick to be passed a context
1 parent c8a168b commit 6731444

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/utils.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,13 @@ var utils = module.exports = {
247247
/**
248248
* used to defer batch updates
249249
*/
250-
nextTick: function (cb) {
251-
defer(cb, 0)
250+
nextTick: function (cb, context) {
251+
if (context) {
252+
defer(utils.bind(cb, context), 0)
253+
}
254+
else {
255+
defer(cb, 0)
256+
}
252257
},
253258

254259
/**
@@ -310,7 +315,7 @@ function enableDebug () {
310315
console.log(msg)
311316
}
312317
}
313-
318+
314319
/**
315320
* warnings, traces by default
316321
* can be suppressed by `silent` option.

0 commit comments

Comments
 (0)