摘要:
vue ui 阅读全文
摘要:
router.js // 全局路由导航守卫 router.beforeEach((to, from, next) => { const tokenStr = localStorage.getItem('token') if (to.path '/main' && !tokenStr) { // 证明 阅读全文
摘要:
router.js { name: 'mov', path: '/movie/:mid', component: Movie, props: true }, home.vue <template> <div> <h3>MyHome 组件</h3> <router-link :to="{ name: 阅读全文
摘要:
导航到另一个页面 <template> <div> <h3>MyHome 组件</h3> <button type="button" class="btn btn-primary" @click="goToMovie(3)">导航到Movie页面</button> </div> </template 阅读全文
摘要:
router.js import { createRouter, createWebHashHistory } from 'vue-router' import Home from './MyHome.vue' import Movie from './MyMovie.vue' import Abo 阅读全文
摘要:
router.js import { createRouter, createWebHashHistory } from 'vue-router' import Home from './MyHome.vue' import Movie from './MyMovie.vue' import Abo 阅读全文
摘要:
router.js // 自定义路由高亮的 class 类 linkActiveClass: 'active-router', index.css .active-router { background-color: blue; color: white; font-weight: bold; } 阅读全文
摘要:
route.js routes: [ { path: '/', redirect: '/home' }, { path: '/home', component: Home }, ], 阅读全文