鍒濆鎻愪氦锛氱墰鍙暟鎹鐞嗙郴缁?- 鍖呭惈鍚庣Spring Boot鍜屽墠绔疺ue3椤圭洰

This commit is contained in:
shenquanyi
2025-11-28 17:19:49 +08:00
commit 4de35a7e5b
9890 changed files with 1020261 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var shared = require('@vue/shared');
const REPEAT_INTERVAL = 100;
const REPEAT_DELAY = 600;
const SCOPE = "_RepeatClick";
const vRepeatClick = {
beforeMount(el, binding) {
const value = binding.value;
const { interval = REPEAT_INTERVAL, delay = REPEAT_DELAY } = shared.isFunction(value) ? {} : value;
let intervalId;
let delayId;
const handler = () => shared.isFunction(value) ? value() : value.handler();
const clear = () => {
if (delayId) {
clearTimeout(delayId);
delayId = void 0;
}
if (intervalId) {
clearInterval(intervalId);
intervalId = void 0;
}
};
const start = (evt) => {
if (evt.button !== 0)
return;
clear();
handler();
document.addEventListener("mouseup", clear, { once: true });
delayId = setTimeout(() => {
intervalId = setInterval(() => {
handler();
}, interval);
}, delay);
};
el[SCOPE] = { start, clear };
el.addEventListener("mousedown", start);
},
unmounted(el) {
if (!el[SCOPE])
return;
const { start, clear } = el[SCOPE];
if (start) {
el.removeEventListener("mousedown", start);
}
if (clear) {
clear();
document.removeEventListener("mouseup", clear);
}
el[SCOPE] = null;
}
};
exports.REPEAT_DELAY = REPEAT_DELAY;
exports.REPEAT_INTERVAL = REPEAT_INTERVAL;
exports.vRepeatClick = vRepeatClick;
//# sourceMappingURL=index.js.map