Skip to content
Snippets Groups Projects
Commit 642a51a5 authored by syuilo's avatar syuilo
Browse files

fix(client): nextTickの中でonUnmounted呼び出しても効かない可能性がある

parent 1c6ab544
No related branches found
No related tags found
No related merge requests found
......@@ -180,12 +180,12 @@ const setPosition = () => {
el.value.style.top = top + 'px';
};
let loopHandler;
onMounted(() => {
nextTick(() => {
setPosition();
let loopHandler;
const loop = () => {
loopHandler = window.requestAnimationFrame(() => {
setPosition();
......@@ -194,12 +194,12 @@ onMounted(() => {
};
loop();
onUnmounted(() => {
window.cancelAnimationFrame(loopHandler);
});
});
});
onUnmounted(() => {
window.cancelAnimationFrame(loopHandler);
});
</script>
<style lang="scss" scoped>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment