摘要: 一、案例搭建 新建Profile组件 组件写好内容后配置路由 { path : '/profile', component : () => import('../components/Profile') } 二、参数配置 App.vue配置profile 我们可以使用对象对to的url进行封装 pa 阅读全文
posted @ 2020-11-01 21:10 emdzz 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 一、配置路由懒加载 懒加载的原因: 因为组件不断的增加,项目的路由会越来越多 打包后的文件越来越大,当超过IO读写的瓶颈时,项目加载就很慢了 所以需要将路由文件分离,在被调用时进行加载 分析路由index.js文件: import Vue from 'vue'; import Router from 阅读全文
posted @ 2020-11-01 15:29 emdzz 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 一、设置首页重定向: import Vue from 'vue'; import Router from 'vue-router'; import Home from "../components/Home"; import About from "../components/About"; Vue 阅读全文
posted @ 2020-11-01 14:02 emdzz 阅读(362) 评论(0) 推荐(0) 编辑
摘要: 一、箭头函数(Lambda匿名函数) <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <script type="text/javascript"> 阅读全文
posted @ 2020-11-01 13:07 emdzz 阅读(113) 评论(0) 推荐(0) 编辑