哈希模式:带#(vue常用)
history模式:不带#(react常用)--主要是为了好看

404
main.js
import NotFound from '@/components/NotFound.vue'
{ path: '*', component: NotFound }//最下面写
NotFound.vue
404NotFound
本文介绍在前端应用中如何配置路由以显示404未找到页面,包括使用Vue和React时的区别,并展示了具体的代码实现。
哈希模式:带#(vue常用)
history模式:不带#(react常用)--主要是为了好看

main.js
import NotFound from '@/components/NotFound.vue'
{ path: '*', component: NotFound }//最下面写
NotFound.vue
404NotFound

被折叠的 条评论
为什么被折叠?