mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-17 03:14:46 +00:00
21 lines
542 B
Vue
21 lines
542 B
Vue
<script setup lang="ts">
|
|
definePageMeta({
|
|
middleware: defineNuxtRouteMiddleware(async (to, from) => {
|
|
const nuxtApp = useNuxtApp()
|
|
if (process.client && from !== to && !nuxtApp.isHydrating) {
|
|
// trigger a loading error when navigated to via client-side navigation
|
|
await import(/* webpackIgnore: true */ /* @vite-ignore */ `some-non-exis${''}ting-module`)
|
|
}
|
|
})
|
|
})
|
|
const someValue = useState('val', () => 1)
|
|
</script>
|
|
|
|
<template>
|
|
<div>
|
|
Chunk error page
|
|
<hr>
|
|
State: {{ someValue }}
|
|
</div>
|
|
</template>
|