随笔分类 -  vue-router

摘要:我写了一个简单的路由如下: import { createRouter, createWebHistory } from 'vue-router' const routes = [ { path: '/login', name: 'Login', component: () => import('@ 阅读全文
posted @ 2022-07-14 18:14 Texley 阅读(1762) 评论(0) 推荐(0)
摘要:路由重定向 在创建路由时可以用redirect参数指定默认访问路径 写法1 const routes = [{ path: "/", component: () => import("../components/root.vue"), redirect: to => { return "user1" 阅读全文
posted @ 2022-07-08 08:47 Texley 阅读(45) 评论(0) 推荐(0)
摘要:这是我基于vue3的进阶学习,学习vue-router以便搭建单页面应用。使用的是js,等练过一遍再改用ts。 前面学的一些还没有做笔记,暂定此随笔为第四章。 路由传参 方式一(query传参) 一个简单的表格,数据为data.json,toDetail函数调用router.push方法,然后使用q 阅读全文
posted @ 2022-07-07 16:15 Texley 阅读(82) 评论(0) 推荐(0)