fix: optimize template hover state with v-memo and release DOM refs on unmount

This commit is contained in:
Johnpaul
2025-09-23 01:10:11 +01:00
parent 430549767f
commit 4a784dfbcb

View File

@@ -141,6 +141,7 @@
v-for="template in displayTemplates"
:key="template.name"
ref="cardRefs"
v-memo="[template.name, hoveredTemplate === template.name]"
ratio="none"
:max-width="300"
:min-width="200"
@@ -355,7 +356,7 @@
<script setup lang="ts">
import ProgressSpinner from 'primevue/progressspinner'
import { computed, onMounted, provide, ref, watch } from 'vue'
import { computed, onBeforeUnmount, onMounted, provide, ref, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import IconTextButton from '@/components/button/IconTextButton.vue'
@@ -668,6 +669,9 @@ onMounted(async () => {
await workflowTemplatesStore.loadWorkflowTemplates()
isLoading.value = false
})
onBeforeUnmount(() => {
cardRefs.value = [] // Release DOM refs
})
</script>
<style>