mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-20 16:08:14 +00:00
perf: @结果相同时避免刷新
This commit is contained in:
parent
4d5c5b052d
commit
a63b867a5a
@ -576,6 +576,7 @@ export default {
|
|||||||
containers[i].classList.add(mentionName);
|
containers[i].classList.add(mentionName);
|
||||||
$A.scrollPreventThrough(containers[i]);
|
$A.scrollPreventThrough(containers[i]);
|
||||||
}
|
}
|
||||||
|
let mentionSourceCache = null;
|
||||||
this.getMentionSource(mentionChar, searchTerm, array => {
|
this.getMentionSource(mentionChar, searchTerm, array => {
|
||||||
const values = [];
|
const values = [];
|
||||||
array.some(item => {
|
array.some(item => {
|
||||||
@ -588,7 +589,10 @@ export default {
|
|||||||
values.push(...list)
|
values.push(...list)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
renderList(values, searchTerm);
|
if ($A.jsonStringify(values.map(({id}) => id)) !== mentionSourceCache) {
|
||||||
|
mentionSourceCache = $A.jsonStringify(values.map(({id}) => id))
|
||||||
|
renderList(values, searchTerm);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user