摘要: 常用的编程式导航 API 如下: this.$route.push('hash地址')。 //给个hash地址就能跳转到指定的页面 this.$router.go(n). //为了实现前进和后退的,n是个数值,传的是1,就是历史记录中向前走一位,如果是-1,就是在历史记录中向后退一位 const U 阅读全文
posted @ 2024-03-17 13:56 “好”久不见 阅读(3) 评论(0) 推荐(0) 编辑
摘要: const router = new VueRouuter({ routes:[ {path:'/user/:id' , name: 'user' , component: User} ] }) <router-link to="{ name : 'user' , params : { id : 1 阅读全文
posted @ 2024-03-17 13:38 “好”久不见 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 1.props的值为布尔类型 const User={ props:['id'], //使用 props 接收路由参数 template:'<div>用户ID: {{ id }} </div>' //使用路由参数 } const router=new VueRouter({ routes:[ //如 阅读全文
posted @ 2024-03-17 13:01 “好”久不见 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 应用场景:通过动态路由参数的模式进行路由匹配 <router-link to="/user/1">User1</router-link> <router-link to="/user/2">User2</router-link> <router-link to="/user/3">User3</ro 阅读全文
posted @ 2024-03-17 12:38 “好”久不见 阅读(4) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document< 阅读全文
posted @ 2024-03-17 12:32 “好”久不见 阅读(1) 评论(0) 推荐(0) 编辑
摘要: commit 阅读全文
posted @ 2024-03-17 11:44 “好”久不见 阅读(2) 评论(0) 推荐(0) 编辑
摘要: Vue Router(官网 https://router.vuejs.org/zh/)是 Vue.js 官方的路由管理器。 Vue Router包含的功能有: 支持HTML5历史模式或hash模式 支持嵌套路由 支持路由参数 支持编程式路由 支持命名路由 基本使用: 1.引入相关的库文件。 ***如 阅读全文
posted @ 2024-03-17 11:43 “好”久不见 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 路由重定向指的是:用户在访问地址A的时候,强制用户跳转到地址C,从而展示特定的组件页面。 通过路由规则的 redirect 属性,指定一个新的路由地址,可以很方便设置路由的重定向。 const router = new VueRouter({ routes:[ {path : '/' , redir 阅读全文
posted @ 2024-03-17 11:43 “好”久不见 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 切图 链接:http://www.cutterman.cn/zh/cutterman 阅读全文
posted @ 2024-03-17 11:43 “好”久不见 阅读(1) 评论(0) 推荐(0) 编辑