摘要:
router.js // 全局路由导航守卫 router.beforeEach((to, from, next) => { const tokenStr = localStorage.getItem('token') if (to.path '/main' && !tokenStr) { // 证明 阅读全文
posted @ 2022-06-08 14:36
hi123hi159
阅读(62)
评论(0)
推荐(0)
摘要:
router.js { name: 'mov', path: '/movie/:mid', component: Movie, props: true }, home.vue <template> <div> <h3>MyHome 组件</h3> <router-link :to="{ name: 阅读全文
posted @ 2022-06-08 14:17
hi123hi159
阅读(49)
评论(0)
推荐(0)
摘要:
导航到另一个页面 <template> <div> <h3>MyHome 组件</h3> <button type="button" class="btn btn-primary" @click="goToMovie(3)">导航到Movie页面</button> </div> </template 阅读全文
posted @ 2022-06-08 13:44
hi123hi159
阅读(72)
评论(0)
推荐(0)
摘要:
router.js import { createRouter, createWebHashHistory } from 'vue-router' import Home from './MyHome.vue' import Movie from './MyMovie.vue' import Abo 阅读全文
posted @ 2022-06-08 13:16
hi123hi159
阅读(824)
评论(0)
推荐(0)
摘要:
router.js import { createRouter, createWebHashHistory } from 'vue-router' import Home from './MyHome.vue' import Movie from './MyMovie.vue' import Abo 阅读全文
posted @ 2022-06-08 13:01
hi123hi159
阅读(257)
评论(0)
推荐(0)
摘要:
router.js // 自定义路由高亮的 class 类 linkActiveClass: 'active-router', index.css .active-router { background-color: blue; color: white; font-weight: bold; } 阅读全文
posted @ 2022-06-08 12:15
hi123hi159
阅读(48)
评论(0)
推荐(0)
摘要:
route.js routes: [ { path: '/', redirect: '/home' }, { path: '/home', component: Home }, ], 阅读全文
posted @ 2022-06-08 12:06
hi123hi159
阅读(169)
评论(0)
推荐(0)
浙公网安备 33010602011771号