在从零开始搭建一个VUE3.0项目之基础搭建(一) 之后,接下来需要进行单页面上的开发,通过vue-router进行页面路由。 第一步: 首先创建一个用来管理所有路由的js import { createRouter, createWebHistory } from 'vue-router' export const constantRoutes = [ { path: '/', //重定向到home界面 redirect: "/home" }, { path: '/home', component: () => import('@/views/home.vue'), meta: { title: '首页' } }, { path: '/login', //如果写成:component: () => import('@/views/login') 自动匹配login文件夹下面的index.vue 等价于下面的写法 component: () => import('@/views/login/index.vue'), meta: { title: '登录界面' } } .... 从零开始搭建一个VUE3.0项目之路由跳转和拦截(二) vue
最近自己在弄前端相关的一些东西,特此记录下在这个过程当中学习到的前端技术知识点和BUG处理方式 VUE BUG以及知识点资料博文 VUE 路由守卫 next() / next({ ...to, replace: true }) / next(‘/‘) 说明 vue通过路由跳转页面的三种方式 Missing required prop: “value” 报错的解决办法 element plus报错:Can't import the named export 'ArrowDown' from non EcmaScript module (only default export is available) (2021-11-12 添加) JS BUG以及知识点资料博文 1 JS判断数据类型的几种方式 2 vscode中的 jsconfig.json (2021-10-27添加) CSS BUG以及知识点资料博文 1 CSS技巧(一):清除浮动 2 js判断页面图片是否存在,并设置默认值 3 几个div在一行的三种方法 4 rem与px的转换 (2021-10-20 添加) 前端技术知识点BUG资料博文(不断更新当中) vue