js
_潮汐海灵_
开通博客主要还是记录自己平时遇到的一些问题,因为有些问题自己也不是深入了解,欢迎相互探讨,与君共勉~
展开
-
call apply bind
call apply bind共同点:1、均能改变 this 指向,且指向第一个参数2、均从第二个参数开始传参不同点1、call apply 均能立即执行函数,而 bind 是稍后执行,需要执行即在后面添加 ( )2、call bind 后面参数个数、格式不限制,apply 只有两个参数,第二个参数是数组,为所有参数的集合<script> let obj = { name: 'qwe', age: 18 }原创 2021-01-29 16:19:07 · 142 阅读 · 0 评论 -
js 笔记
记录项目中遇到的问题,便于查阅,持续更新。。。一、函数1、问题描述:优化代码过程中,对数据处理用到的是同一种格式,考虑封装,对于return 的应用handleLine(){} 是数据处理方法,在方法内数据都处理成功,且打印正常,但是并未挂载到this.IA_data_arr 上解决方法—因为已经把处理过的数据给return ,直接接收赋值即可...原创 2021-01-11 16:31:44 · 90 阅读 · 0 评论 -
js筛选对象中的空值
如果对象中属性比较多,可以循环对象 let data = { "id": this.equipmentID, "codeName": this.equipmentName, "equipmentInfo": this.equipmentSite, "pageSize": this.pageSize, "pageNum": this.currentPage } let newData = {}原创 2020-11-18 16:45:02 · 2782 阅读 · 0 评论 -
获取当前时间并计时
封装函数----methods:{ //获取当前时间 getDate(){ let that = this this.timer=setInterval(function(){ let dt = new Date(); let days = ["星期日", "星期一",原创 2020-11-06 11:19:13 · 236 阅读 · 0 评论 -
js 报错 Cannot read property ‘dictTreeList‘ of undefined,但数据却存在
js报错信息Error in render: "TypeError: Cannot read property 'dictTreeList' of undefined" vue.esm.js?a026:1897TypeError: Cannot read property 'dictTreeList' of undefined数据的获取 const { data: res } = await this.$http.get('course/getCourseList?userId=原创 2020-09-18 10:09:08 · 198 阅读 · 0 评论