【发布时间】:2022-08-19 16:37:54
【问题描述】:
在 Nuxt.js 中,有没有办法全局处理任何服务器端错误?
我想有条件地重定向到我自己的 Vue 错误页面。例如:
if (process.env.NODE_ENV === \'production\') {
redirect(\"/error?message=the-error-message-here\");
} else {
// render the default server error page with the stack trace
}
这可能吗?
我读过有关创建app/views/error.html 的信息,但这并没有改变任何东西。
标签: nuxt.js