mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-15 02:14:44 +00:00
26 lines
464 B
Vue
26 lines
464 B
Vue
|
<script setup>
|
||
|
const hasIssue = ref(true)
|
||
|
|
||
|
const fixIssue = (error) => {
|
||
|
hasIssue.value = false
|
||
|
error.value = null
|
||
|
}
|
||
|
|
||
|
</script>
|
||
|
|
||
|
<template>
|
||
|
<NuxtErrorBoundary>
|
||
|
<throw-error v-if="hasIssue" />
|
||
|
<div v-else>
|
||
|
Component is working ^_^
|
||
|
</div>
|
||
|
|
||
|
<template #error="{ error }">
|
||
|
Component failed to Render -_-
|
||
|
<button @click="fixIssue(error)">
|
||
|
(fix the issue)
|
||
|
</button>
|
||
|
</template>
|
||
|
</NuxtErrorBoundary>
|
||
|
</template>
|