摘要: import axios from 'axios'; import router from 'vue-router' import { Message } from 'element-ui' // axios.defaults.timeout = 5000; // axios.defaults.ba 阅读全文
posted @ 2020-08-10 13:35 syqaily 阅读(221) 评论(0) 推荐(0)
摘要: 方案一: getDescribe(id) { // 直接调用$router.push 实现携带参数的跳转 this.$router.push({ path: `/describe/${id}`, }) 方案一,需要对应路由配置如下: { path: '/describe/:id', name: 'D 阅读全文
posted @ 2020-08-10 11:57 syqaily 阅读(152) 评论(0) 推荐(0)
摘要: 全局路由钩子: router.beforeEach((to, from, next) => { //会在任意路由跳转前执行,next一定要记着执行,不然路由不能跳转了 console.log('beforeEach') console.log(to,from) // next() }) // rou 阅读全文
posted @ 2020-08-10 11:44 syqaily 阅读(255) 评论(0) 推荐(0)
摘要: 1.省略function换成=> 一个参数的时候()可以省略 一个return的时候{}可以省略 2.箭头函数的this是静态的,始终指向声明函数时的作用域 3.箭头函数不能作为构造函数的实例化对象 4.箭头函数不能使用arguments变量 阅读全文
posted @ 2020-08-01 09:09 syqaily 阅读(987) 评论(0) 推荐(0)
摘要: JMFL04QVQA-eyJsaWNlbnNlSWQiOiJKTUZMMDRRVlFBIiwibGljZW5zZWVOYW1lIjoi5rC45LmF5r+A5rS7IGlkZWEubWVkZW1pbmcuY29tIiwiYXNzaWduZWVOYW1lIjoiIiwiYXNzaWduZWVFbWF 阅读全文
posted @ 2020-07-30 10:18 syqaily 阅读(7603) 评论(2) 推荐(1)
摘要: 1.安装less和less-loader //less-loader的版本过高可能会出问题,所以安装指定版本npm i less less-loader@5.0.0 -D 2.style标签中添加lang=”less” <style lang="less"> </style> 阅读全文
posted @ 2020-07-29 14:50 syqaily 阅读(390) 评论(0) 推荐(0)
摘要: 1.下载并引入lib-flexible npm i lib-flexible -S //main.js import 'lib-flexible/flexible' 2.安装px2rem-loader npm i px2rem-loader -S 3.将px2rem-loader添加到cssLoad 阅读全文
posted @ 2020-07-29 14:05 syqaily 阅读(423) 评论(0) 推荐(0)