06 2022 档案

摘要:vue ui 阅读全文
posted @ 2022-06-16 16:03 hi123hi159 阅读(14) 评论(0) 推荐(0)
摘要:router.js // 全局路由导航守卫 router.beforeEach((to, from, next) => { const tokenStr = localStorage.getItem('token') if (to.path '/main' && !tokenStr) { // 证明 阅读全文
posted @ 2022-06-08 14:36 hi123hi159 阅读(65) 评论(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 阅读(52) 评论(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 阅读(74) 评论(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 阅读(261) 评论(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 阅读(50) 评论(0) 推荐(0)
摘要:route.js routes: [ { path: '/', redirect: '/home' }, { path: '/home', component: Home }, ], 阅读全文
posted @ 2022-06-08 12:06 hi123hi159 阅读(173) 评论(0) 推荐(0)
摘要:app.vue <template> <div> <h1>vue-router 的基本使用</h1> <!-- 声明路由链接 --> <router-link to="/home">首页</router-link>&nbsp; <router-link to="/movie">电影</router- 阅读全文
posted @ 2022-06-06 15:00 hi123hi159 阅读(42) 评论(0) 推荐(0)
摘要:npm i vue-router@next -S 阅读全文
posted @ 2022-06-06 14:03 hi123hi159 阅读(107) 评论(0) 推荐(0)
摘要:app.vue <template> <div> <h1>App 根组件</h1> <a href="#/home">Home</a>&nbsp; <a href="#/movie">Movie</a>&nbsp; <a href="#/about">About</a>&nbsp; <hr /> < 阅读全文
posted @ 2022-06-06 13:57 hi123hi159 阅读(24) 评论(0) 推荐(0)
摘要:app.vue <template> <div> <h1>App 根组件</h1> <hr /> <!-- 使用组件 --> <my-home></my-home> </div> </template> <script> // 导入组件 import MyHome from './Home.vue' 阅读全文
posted @ 2022-06-06 13:02 hi123hi159 阅读(169) 评论(0) 推荐(0)
摘要:app.vue <template> <div> <h1>App 根组件</h1> <hr /> <!-- 使用自定义组件 --> <my-test> <template #default="{ msg, info }"> <p>{{ msg }}</p> <p>{{ info.address }} 阅读全文
posted @ 2022-06-06 12:48 hi123hi159 阅读(34) 评论(0) 推荐(0)
摘要:app.vue <template> <div> <h1>App 根组件</h1> <hr /> <!-- 使用组件 --> <my-article> <template #header> <h1>滕王阁序</h1> </template> <template #default> <p>豫章故郡,洪 阅读全文
posted @ 2022-06-06 12:20 hi123hi159 阅读(29) 评论(0) 推荐(0)
摘要:app.vue <template> <div> <h1>App 根组件</h1> <hr /> <!-- 使用组件 --> <my-com> </my-com> </div> </template> <script> // 导入组件 import MyCom from './MyCom.vue' 阅读全文
posted @ 2022-06-06 12:03 hi123hi159 阅读(23) 评论(0) 推荐(0)
摘要:app.vue <template> <div> <h1 class="mb-4">App 根组件</h1> <button type="button" class="btn btn-primary" @click="comName = 'MyHome'">首页</button> <button t 阅读全文
posted @ 2022-06-06 11:49 hi123hi159 阅读(189) 评论(0) 推荐(0)
摘要:npm init vite-app 项目名称 cd 项目路径 npm i npm run dev 阅读全文
posted @ 2022-06-02 16:43 hi123hi159 阅读(43) 评论(0) 推荐(0)