摘要: 在vue项目中,当再次点击当前看路由时,会在控制台报如下警告: Avoided redundant navigation to current location:"/xxx/xxx" 解决方法: 在router.js中添加如下代码 import Vue from 'vue' import Route 阅读全文
posted @ 2021-07-01 11:20 icon-icon 阅读(1650) 评论(0) 推荐(0)
摘要: 1、自定义指令 // 注册一个全局自定义指令 `v-abc` Vue.directive('abc', { bind: function (el) { // 只调用一次,指令第一次绑定到元素时调用。在这里可以进行一次性的初始化设置 }, inserted: function (el) { // 被绑 阅读全文
posted @ 2021-07-01 11:00 icon-icon 阅读(90) 评论(0) 推荐(0)
摘要: 当点击选中时使用check-change函数处理数据发现check-change事件被执行多次, check-change监听状态改变,在此处点击勾选后状态发生改变,因此再次触发了check-change事件 check事件监听点击动作,只在点击时触发 将check-change事件改为check事 阅读全文
posted @ 2021-06-28 18:41 icon-icon 阅读(4346) 评论(0) 推荐(0)
摘要: 在vscode中使用cnpm命令时报错如下: 解决方案: 使用管理员身份启动powershell: 输入命令:set-ExecutionPolicy RemoteSigned,然后更改权限为A,修改成功后通过 get-ExecutionPolicy 查看当前的状态 阅读全文
posted @ 2021-06-15 11:48 icon-icon 阅读(215) 评论(0) 推荐(0)
摘要: 1、axios请求文件流 import axios from 'axios' export const downLoadfile = (id)=> { return axios({ url: window.localStorage.url + `/base/report/download/repor 阅读全文
posted @ 2021-06-11 15:58 icon-icon 阅读(69) 评论(0) 推荐(0)
摘要: get 获取/set 设置, add 增加/remove 删除 create 创建/destory 移除 start 启动/stop 停止 open 打开/close 关闭, read 读取/write 写入 load 载入/save 保存, create 创建/destroy 销毁 begin 开 阅读全文
posted @ 2021-06-07 11:28 icon-icon 阅读(156) 评论(0) 推荐(0)
摘要: var array = [1,2,3,4,5]; try { // 执行到第3次,结束循环 array.forEach((item, index)=> { // debugger if (item == 3) { throw new Error("跳出循环"); } console.log(item 阅读全文
posted @ 2021-06-03 11:28 icon-icon 阅读(109) 评论(0) 推荐(0)
摘要: 一、微信小程序从开发到上线流程 注册小程序 1、登录微信公众平台 https://mp.weixin.qq.com 2、在微信公众平台>立即注册>小程序中注册微信小程序 3、在邮箱中激活并完善开发者资料,填写企业信息 4、提交审核 5、审核通过之后,在微信公众平台登陆小程序设置小程序基本信息 ​ 6 阅读全文
posted @ 2021-06-02 09:07 icon-icon 阅读(2795) 评论(0) 推荐(0)
摘要: 小程序优化 1、调试器 Audits 评分报告定位问题 ​ 打开调试器 Audits 面板,点击”开始“按钮,然后自行操作小程序界面,运行过的页面就会被“体验评分”检测到。运行完后,会生成评分报告。未通过项可以定位到文件中,并给出优化建议。可根据优化建议对相应功能进行优化。 ​ 也可在项目配置文件中 阅读全文
posted @ 2021-06-02 09:04 icon-icon 阅读(274) 评论(0) 推荐(0)
摘要: vue v-for循环中为什么要用key?为什么index不能作为key? key 的特殊 attribute 主要用在 Vue 的虚拟 DOM 算法,在新旧 nodes 对比时辨识 VNodes。如果不使用 key,Vue 会使用一种最大限度减少动态元素并且尽可能的尝试就地修改/复用相同类型元素的 阅读全文
posted @ 2021-04-06 10:16 icon-icon 阅读(63) 评论(0) 推荐(0)