摘要: 1.如不使用router-link <!-- <router-link to="/home" tag="button" replace>首页</router-link> <router-link to="/about">关于</router-link> --> <button @click="hom 阅读全文
posted @ 2021-06-28 17:13 ajaXJson 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 1.tag 指定router-link之后渲染成什么组件如渲染成button <router-link to="/home" tag="button" repalce>首页</router-link> 2.repace 添加replace不会留下history记录,后退键返回不到上一级元素 3.ac 阅读全文
posted @ 2021-06-28 17:11 ajaXJson 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 1.router下index 配置映射规则中新增一个对象 { // redirect路由重定向 path:'', redirect:'/home' //重定向地址 } 2.history 因为默认是hash地址,url栏中不美观 http://localhost:8080/home#/home 改变 阅读全文
posted @ 2021-06-28 17:10 ajaXJson 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 1.安装Vue-router npm install vue-router --save 2.components 1.新建About.vue <template> <div> <h2>首页</h2> <p>首页内容</p> </div> </template> <script> export de 阅读全文
posted @ 2021-06-28 17:09 ajaXJson 阅读(80) 评论(0) 推荐(0) 编辑