首页 > 其他分享 >vue:路由错误/404 not found([email protected])

vue:路由错误/404 not found([email protected])

时间:2023-10-04 22:44:20浏览次数:36  
标签:vue 4.2 404 responsive router div com class

 

一,官方文档地址: 

https://router.vuejs.org/zh/guide/essentials/dynamic-matching.html

二, 代码:

1,router配置

 { path: '/:pathMatch(.*)*', name: 'NotFound',meta:{title:"路由未匹配",top:"3"}, component: NotFound },

2,notfound.vue

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 <template>   <div class="nfback" >     <div class="nfmainback"></div>     <div class="nfmain" >       <div class="nfrgba"></div>       <div class="nf_content_text">       <h1 class="title" style="text-align: center;" data-v-bad1fafc="">路由错误</h1>       </div>     </div><!--main end-->   </div> </template> <script> export default {   name: 'LayoutNotFound',   setup() {     return {     };   }, } </script> <style scoped> :root {   --el-component-size: 40px; } .nfmain {   flex: none;   margin: 0 auto;   border-radius: 4px;   z-index: 0;   position: relative;   overflow: hidden; } </style>

三,测试效果:

胡乱填写一个不存在的路径,显示了NotFound页面的内容:

说明:刘宏缔的架构森林—专注it技术的博客,
网站:https://blog.imgtouch.com
原文: https://blog.imgtouch.com/index.php/2023/10/01/vue-lu-you-cuo-wu-404-not-found-vuerouter-4-2-4/
代码: https://github.com/liuhongdi/ 或 https://gitee.com/liuhongdi
说明:作者:刘宏缔 邮箱: [email protected]

四,查看vue/vue-router的版本:

liuhongdi@lhdpc:/data/vue/responsive$ npm list vue
[email protected] /data/vue/responsive
└─┬ [email protected]
  └─┬ @vue/[email protected]
    └── [email protected] deduped
liuhongdi@lhdpc:/data/vue/responsive/src$ npm list vue-router
[email protected] /data/vue/responsive
└── [email protected]

标签:vue,4.2,404,responsive,router,div,com,class
From: https://www.cnblogs.com/architectforest/p/17742876.html

相关文章

  • vue中beforedistory应用
    遇到一个问题,就是我在使用全局事件总线的时候发布了一个事件,然后在a组件里面这个时间会被触发一次,在b组件里面也会触发一次.这两个组件是平级组件不是嵌套组件.然后呢,在a组件触发完之后,我去了b组件,在b组件中触发相同时间的时候,a组件的逻辑和b组件的逻辑都执行了一次.一开......
  • 搭建Springboot+Vue+Element的简单系统流程
    今天研究了一下如何把Springboot+Mybatis和Vue+Element结合起来使用详细写一篇博客来记录一下流程吧,因为途中发现了很多的问题首先,创建Springboot项目,惯例添加依赖<?xmlversion="1.0"encoding="UTF-8"?><projectxmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="htt......
  • Vue扩展组件系列
    ---注意日期范围都是要日期/时间两种格式(date/datetime,默认值:date)1、日期范围快选【当前日期-7天,当前日期】近期三天、一个周、一个月、三个月、一年v-model= {FieldName:'CTime',FieldValue:[]} 2、快速筛选2截至日期【选择字段】+日期框v-model= {FieldNam......
  • dremio 24.2 社区版发布
    就在昨天,dremio提供了社区版的下载地址,24.2提供了不少新特性主要新特性deltalake不少新功能支持(历史,快照)反射hints支持(可以基于声明式定义)一些新的半结构化数据聚合参数自动反射推荐功能一些查询计划的优化(主要是修复一些历史之行计划的问题)对于分布式存储移除过期的......
  • vue3 使用 i18n
    安装官网:https://vue-i18n.intlify.dev/api/general.htmlpnpmaddvue-i18n@9使用//@/locale/index.tsimportappConfigfrom"@/configure/app.config.ts";import{nextTick}from'vue'importtype{Ref}from'vue'import{createI18n}......
  • 在 WebStorm 里调试 vue3 项目
    官方说明:https://blog.jetbrains.com/webstorm/2018/01/working-with-vue-js-in-webstorm/#:~:text=Wecandebugourapplication,andstartthedebugsession.打开WebStorm编辑器右上角的Configuration的Edit,在URL填入项目的地址并选择想要使用的Brower,点击调试之......
  • vue3 使用 pinia
    安装pinia官网:https://pinia.vuejs.org/pnpmaddpinia使用新建pinia实例//@/store/index.tsimport{createPinia}from"pinia";importuseUserStorefrom"@/store/user.ts";exportuseUserStore;constpinia=createPinia();exportdefault......
  • vue3 使用 vue-router
    安装vue-routerpnpmivue-router使用vue-router创建自己的router//@/route/index.tsimport{createRouter,createWebHashHistory}from'vue-router'importtype{RouteRecordRaw}from"vue-router"constroutes:RouteRecordRaw[]=[{......
  • 1小时学会Vue之VueRouter&Vuex 学习笔记
    https://www.bilibili.com/video/BV1zF411R7cR/开发工具推荐vue-devtool  地址 https://devtools.vuejs.org/guide/installation.html一 router动态路由嵌套路由编程式导航导航守卫 二vuex ......
  • TP5环境静态文件报404的解决方案
    主要还是站点配置文件,找到vhost下的站点配置文件,代码如下server{listen80;server_namewww.test.comtest.com;indexindex.htmlindex.htmindex.php;#include/usr/local/nginx/conf/rewrite/none.conf;root/home/wwwroot/myproject888/;#根目录路径#......