提交 35f67a50 编写于 作者: fxy060608's avatar fxy060608

fix(mp): revert invalidateJob (#3408)

上级 dfaf5575
......@@ -60,8 +60,13 @@ export function updateComponentProps(
const nextProps = findComponentPropsData(up) || {}
if (hasPropsChanged(prevProps, nextProps)) {
updateProps(instance, nextProps, prevProps, false)
invalidateJob(instance.update)
instance.update()
const index = invalidateJob(instance.update)
if (__PLATFORM__ === 'mp-toutiao') {
// 字节跳动小程序 https://github.com/dcloudio/uni-app/issues/3340
index === -1 && instance.update()
} else {
instance.update()
}
}
}
......
......@@ -1413,6 +1413,14 @@ function queueFlush() {
currentFlushPromise = resolvedPromise.then(flushJobs);
}
}
function invalidateJob(job) {
const i = queue.indexOf(job);
if (i > flushIndex) {
queue.splice(i, 1);
}
// fixed by xxxxxx
return i;
}
function queueCb(cb, activeQueue, pendingQueue, index) {
if (!isArray(cb)) {
if (!activeQueue ||
......@@ -4428,12 +4436,6 @@ function unwrapper(target) {
}
function defineAsyncComponent(source) {
console.error('defineAsyncComponent is unsupported');
}
function invalidateJob(job) {
const i = queue.indexOf(job);
if (i > -1) {
queue.splice(i, 1);
}
}
// import deepCopy from './deepCopy'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册