refactor(client): specify global scope

This commit is contained in:
syuilo
2022-01-16 10:14:14 +09:00
parent b312846ff6
commit 8322c90834
30 changed files with 75 additions and 75 deletions

View File

@ -90,7 +90,7 @@ onMounted(() => {
const update = () => {
if (enabled.value) {
tick();
setTimeout(update, 1000);
window.setTimeout(update, 1000);
}
};
update();

View File

@ -90,7 +90,7 @@ function requestRender() {
'error-callback': callback,
});
} else {
setTimeout(requestRender, 1);
window.setTimeout(requestRender, 1);
}
}

View File

@ -167,7 +167,7 @@ export default defineComponent({
// このコンポーネントが作成された時、非表示状態である場合がある
// 非表示状態だと要素の幅などは0になってしまうので、定期的に計算する
const clock = setInterval(() => {
const clock = window.setInterval(() => {
if (prefixEl.value) {
if (prefixEl.value.offsetWidth) {
inputEl.value.style.paddingLeft = prefixEl.value.offsetWidth + 'px';
@ -181,7 +181,7 @@ export default defineComponent({
}, 100);
onUnmounted(() => {
clearInterval(clock);
window.clearInterval(clock);
});
});
});

View File

@ -117,7 +117,7 @@ export default defineComponent({
// このコンポーネントが作成された時、非表示状態である場合がある
// 非表示状態だと要素の幅などは0になってしまうので、定期的に計算する
const clock = setInterval(() => {
const clock = window.setInterval(() => {
if (prefixEl.value) {
if (prefixEl.value.offsetWidth) {
inputEl.value.style.paddingLeft = prefixEl.value.offsetWidth + 'px';
@ -131,7 +131,7 @@ export default defineComponent({
}, 100);
onUnmounted(() => {
clearInterval(clock);
window.clearInterval(clock);
});
});
});

View File

@ -45,7 +45,7 @@ export default defineComponent({
calc();
const observer = new MutationObserver(() => {
setTimeout(() => {
window.setTimeout(() => {
calc();
}, 100);
});

View File

@ -63,10 +63,10 @@ export default defineComponent({
this.draw();
// Vueが何故かWatchを発動させない場合があるので
this.clock = setInterval(this.draw, 1000);
this.clock = window.setInterval(this.draw, 1000);
},
beforeUnmount() {
clearInterval(this.clock);
window.clearInterval(this.clock);
},
methods: {
draw() {

View File

@ -29,7 +29,7 @@ export default defineComponent({
};
},
mounted() {
setTimeout(() => {
window.setTimeout(() => {
this.showing = false;
}, 6000);
}

View File

@ -94,7 +94,7 @@ export default defineComponent({
}
onMounted(() => {
setTimeout(() => {
window.setTimeout(() => {
context.emit('end');
}, 1100);
});

View File

@ -26,7 +26,7 @@ const showing = ref(true);
const zIndex = os.claimZIndex('high');
onMounted(() => {
setTimeout(() => {
window.setTimeout(() => {
showing.value = false;
}, 4000);
});

View File

@ -117,14 +117,14 @@ export default defineComponent({
const scale = calcCircleScale(e.target.clientWidth, e.target.clientHeight, circleCenterX, circleCenterY);
setTimeout(() => {
window.setTimeout(() => {
ripple.style.transform = 'scale(' + (scale / 2) + ')';
}, 1);
setTimeout(() => {
window.setTimeout(() => {
ripple.style.transition = 'all 1s ease';
ripple.style.opacity = '0';
}, 1000);
setTimeout(() => {
window.setTimeout(() => {
if (this.$refs.ripples) this.$refs.ripples.removeChild(ripple);
}, 2000);
}

View File

@ -211,7 +211,7 @@ export default defineComponent({
contentClicking = true;
window.addEventListener('mouseup', e => {
// click イベントより先に mouseup イベントが発生するかもしれないのでちょっと待つ
setTimeout(() => {
window.setTimeout(() => {
contentClicking = false;
}, 100);
}, { passive: true, once: true });