mirror of
https://gitee.com/ElemeFE/element.git
synced 2024-12-02 04:08:10 +08:00
chore: avoid creating object for performance upgrade (#14776)
This commit is contained in:
parent
f06ef4d82d
commit
88b628bd04
@ -6,7 +6,7 @@ export default {
|
||||
let startTime;
|
||||
const handler = () => vnode.context[binding.expression].apply();
|
||||
const clear = () => {
|
||||
if (new Date() - startTime < 100) {
|
||||
if (Date.now() - startTime < 100) {
|
||||
handler();
|
||||
}
|
||||
clearInterval(interval);
|
||||
@ -15,7 +15,7 @@ export default {
|
||||
|
||||
on(el, 'mousedown', (e) => {
|
||||
if (e.button !== 0) return;
|
||||
startTime = new Date();
|
||||
startTime = Date.now();
|
||||
once(document, 'mouseup', clear);
|
||||
clearInterval(interval);
|
||||
interval = setInterval(handler, 100);
|
||||
|
Loading…
Reference in New Issue
Block a user