diff --git a/src/platforms/app-plus/service/framework/plugins/index.js b/src/platforms/app-plus/service/framework/plugins/index.js index f477de6b5cfc9338a8d4ac9fb9499ee906c82641..aa90011a42219c0682752523fe802391ac3a00d7 100644 --- a/src/platforms/app-plus/service/framework/plugins/index.js +++ b/src/platforms/app-plus/service/framework/plugins/index.js @@ -54,17 +54,19 @@ export default { Vue.prototype.$nextTick = function nextTick (cb) { const renderWatcher = this._watcher + const callback = typeof cb === 'function' if ( renderWatcher && this._$queue.find(watcher => renderWatcher === watcher) ) { - vdSyncCallbacks.push(cb.bind(this)) + const result = new Promise((resolve) => { + vdSyncCallbacks.push(callback ? cb.bind(this) : resolve) + }) + return callback ? result : undefined } else { // $nextTick bind vm context - Vue.nextTick(() => { - cb.call(this) - }) + return Vue.nextTick(callback ? () => cb.call(this) : undefined) } } } -} +}