上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 23 下一页
摘要: 在main.js中或者单独引入(这里是直接写在了main.js中) import axios from 'axios' // 首先引入 Vue.prototype.$ajax = axios // 然后挂载到vue上 // axios请求拦截器 axios.interceptors.request. 阅读全文
posted @ 2021-04-12 15:20 yw3692582 阅读(161) 评论(0) 推荐(0)
摘要: 我使用moment.js只用到了几个常用api,相对来说moment.js体积大一点,而day.js只有2kb,轻量,api和moment一样。 例如: 使用moment.js moment().format('YYYY-MM-DD HH:mm') 使用day.js dayjs().format(' 阅读全文
posted @ 2021-04-12 13:13 yw3692582 阅读(496) 评论(0) 推荐(0)
摘要: Echarts使用时,如果使用同一个图表,则可以写一个通用的函数,在调用的时候只需要传入相应的数据(如:图表的容器id、一些关键数据等)就可以了,这样提高了工作效率和代码的复用率。 阅读全文
posted @ 2021-04-09 11:07 yw3692582 阅读(52) 评论(0) 推荐(0)
摘要: let [a, b, c] = [5, 8, 12]; console.log(a, b, c) // 5, 8, 12 阅读全文
posted @ 2021-04-07 11:20 yw3692582 阅读(5682) 评论(0) 推荐(0)
摘要: let a = 10, b = 5; console.log(a, b) // 10, 5 [a, b] = [b, a] console.log(a, b) // 5, 10 阅读全文
posted @ 2021-04-07 11:18 yw3692582 阅读(252) 评论(0) 推荐(0)
摘要: 解决方案:将el-image换成HTML的自有标签<img></img>即可,这样就不会有闪烁了。 阅读全文
posted @ 2021-04-06 17:19 yw3692582 阅读(3150) 评论(5) 推荐(0)
摘要: // 通过 process.env.NODE_ENV 来判断 process.env.NODE_ENV == 'development' // 开发 process.env.NODE_ENV == 'production' // 生产 阅读全文
posted @ 2021-03-31 17:21 yw3692582 阅读(350) 评论(0) 推荐(0)
摘要: // 防止按钮抖动,思路:获取到本次和上次点击的时间戳,相减小于1000毫秒则return,阻止继续操作 if (new Date().getTime() - this.newTimeStamp < 1000) { return this.$message({ type: 'warning', me 阅读全文
posted @ 2021-03-31 09:58 yw3692582 阅读(460) 评论(0) 推荐(0)
摘要: 安装babel-polyfill:npm install --save-dev babel-polyfill 然后再main.js第一行引入:import 'babel-polyfill' // 解决兼容性问题 阅读全文
posted @ 2021-03-29 15:26 yw3692582 阅读(302) 评论(0) 推荐(0)
摘要: initWebSocket() { //初始化websocket this.ws = new WebSocket(url) // 在data中定义ws为null this.ws.onmessage = this.websocketonmessage this.ws.onopen = this.web 阅读全文
posted @ 2021-03-24 14:31 yw3692582 阅读(96) 评论(0) 推荐(0)
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 23 下一页