我想使用controller.view500(err)并显示自定义系统 View 。
如何显示自定义系统 View 500、400?
https://docs.totaljs.com/latest/en.html#api~FrameworkController~controller.view
谢谢
最佳答案
函数 view500 实际上并不渲染任何 View 。它只是 throw500 的别名。
如果你想渲染一个 View ,你可以定义一个自定义路由,如下所示:
F.route('#500', function(){
// You need to create the view '500.html' file yourself in views folder
this.view('500');
});
然后每当您使用 controller.view500();
时,上面的路由都会处理它。
您传递给 view500
的错误应该在路由 Controller 中作为 controller.exception
关于javascript - Total.js 自定义系统 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41708564/