From 4485b6b81008a78f5a144520a17f43e1d2694561 Mon Sep 17 00:00:00 2001 From: legonzaur Date: Fri, 3 May 2024 00:38:52 +0200 Subject: [PATCH] Do not rotate cards at each update --- components/CardPreview.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/components/CardPreview.vue b/components/CardPreview.vue index 9f4547d..1d8bf7d 100644 --- a/components/CardPreview.vue +++ b/components/CardPreview.vue @@ -31,9 +31,17 @@ function contextmenu(e: MouseEvent) { const rotation = ref(0) -onBeforeUpdate(() => { +// onBeforeUpdate(() => { +// rotation.value = Math.random() > .5 ? 2 : -2 +// }) + + +watch( + () => props.data, + () => { rotation.value = Math.random() > .5 ? 2 : -2 -}) + }, + { immediate: true })