3 Star 34 Fork 16

eoctdm / nuxt3-chinese-examples

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
error.vue 982 Bytes
一键复制 编辑 原始数据 按行查看 历史
pioneer 提交于 2022-11-24 16:17 . 增加预览描述
<template>
<div>
<div>
<div class="app-color-blue app-cursor" @click="home">返回首页</div>
<h1>异常处理之全局错误页面的示例。</h1>
<div class="app-color-grey">当Nuxt3遇到致命错误时,统一跳转到此全局错误页面进行异常处理。</div>
<div>异常数据:</div>
<div class="app-box"><pre>{{JSON.stringify(error,null,2)}}</pre></div>
</div>
</div>
</template>
<script setup>
import headConfig from "~/assets/data/head.js"
const props = defineProps({
error: Object
});
const home = ()=>{
clearError({ redirect: '/' });
}
const pageTKD = {
title: "异常处理之全局错误页面",
keywords: "全局错误页面,异常处理",
description: '当Nuxt3遇到致命错误时展示内容。'
};
const heads = {
title: `${pageTKD.title}-${headConfig.data.appname}`,
meta: []
};
heads.meta.push( ...headConfig.buildMeta(pageTKD));
useHead(heads);
</script>
NodeJS
1
https://gitee.com/eoctdm/nuxt3-chinese-examples.git
git@gitee.com:eoctdm/nuxt3-chinese-examples.git
eoctdm
nuxt3-chinese-examples
nuxt3-chinese-examples
main

搜索帮助