Created
March 30, 2023 15:32
-
-
Save joanfabregat/de1b44a4849f18cd16275f5e83f0b083 to your computer and use it in GitHub Desktop.
Using suspense with router-view
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <router-view v-slot="{ Component }"> | |
| <suspense timeout="0"> | |
| <template #default> | |
| <component :is="Component" :key="$route.path"></component> | |
| </template> | |
| <template #fallback> | |
| <div>Loading...</div> | |
| </template> | |
| </suspense> | |
| </router-view> | |
| <!-- source: https://codesandbox.io/s/q4nsd?file=/src/App.vue:132-414 --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment