Inefficient Mounting of Components with Root Transitions in Vue 3 #7784
Unanswered
jinyongp
asked this question in
Help/Questions
Replies: 2 comments
-
You can write as only one root node. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Ideally, it is best practice to handle the <script setup>
import { ref, onMounted } from 'vue'
const isLoaded = ref(false)
onMounted(() => {
isLoaded.value = true
})
</script>
<BaseLayout v-if="isLoaded">
<template>
<div> Loaded </div>
</template>
</BaseLayout>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In Vue 2, it was possible to use v-if with root transitions in components, but in Vue 3, this is no longer supported. Instead, a prop must be used to control the mounting state. However, this approach can be inefficient when there are multiple components with root transitions on the same page, as all components will be mounted when the page loads. Is there any other alternatives?
Beta Was this translation helpful? Give feedback.
All reactions