Merge branch 'v2' of https://e.coding.net/ctcdevteam/ehs/ehs_web into v2
This commit is contained in:
commit
a79651d7b7
25
src/main.js
25
src/main.js
|
@ -31,3 +31,28 @@ app.mount('#app');
|
||||||
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
||||||
app.component(key, component)
|
app.component(key, component)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const debounce = (fn, delay) => {
|
||||||
|
let timer = null;
|
||||||
|
|
||||||
|
return function () {
|
||||||
|
let context = this;
|
||||||
|
|
||||||
|
let args = arguments;
|
||||||
|
|
||||||
|
clearTimeout(timer);
|
||||||
|
|
||||||
|
timer = setTimeout(function () {
|
||||||
|
fn.apply(context, args);
|
||||||
|
}, delay);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const _ResizeObserver = window.ResizeObserver;
|
||||||
|
|
||||||
|
window.ResizeObserver = class ResizeObserver extends _ResizeObserver {
|
||||||
|
constructor(callback) {
|
||||||
|
callback = debounce(callback, 16);
|
||||||
|
super(callback);
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue