上一页 1 ··· 8 9 10 11 12 13 14 下一页
摘要: 相同点: visibility和display都能实现元素的显示和隐藏display: none; 隐藏元素display: block; 显示元素display: inline; 元素转换为行内元素 display: inline-block; 元素转换为行内块元素 visibility:hidd 阅读全文
posted @ 2022-08-09 18:49 黑白棋学弟 阅读(422) 评论(0) 推荐(0) 编辑
摘要: reduce为数组的一个方法,处理一些数组去重,获取数组出现次数等非常好用,写法为: arr.reduce((preV,cur,index,oldArr)=>{}) 传参: preV:上次调用函数的返回值 cur:当前元素 index:当前元素索引 arr:被遍历的数组 他还可以设置一个初始迭代值, 阅读全文
posted @ 2022-08-09 18:14 黑白棋学弟 阅读(27) 评论(0) 推荐(0) 编辑
摘要: list.sort((a,b)=> { return b.time < a.time ? -1:1 }) 阅读全文
posted @ 2022-08-09 17:49 黑白棋学弟 阅读(274) 评论(0) 推荐(0) 编辑
摘要: let arr = [ { name: "zs", age: 18, id: 1, sex: 0 }, { name: "ls", age: 19, id: 2, sex: 0 }, { name: "zs", age: 19, id: 3, sex: 1 } ]; 找到对象group所对应的数据, 阅读全文
posted @ 2022-08-09 17:44 黑白棋学弟 阅读(441) 评论(0) 推荐(0) 编辑
摘要: 例如根据id去重 方法1:for in的方法 objHeavy(arr) { let arr1 = [];//存id let newArr = [];//存新数组 for(let i in arr) { if(arr1.indexOf(arr[i].id) == -1) { arr1.push(ar 阅读全文
posted @ 2022-08-09 17:35 黑白棋学弟 阅读(897) 评论(0) 推荐(0) 编辑
摘要: 视图更新: push() pop() shift() unshift() splice() sort() reverse() 以下常用的数组操作都不会改变现有的数组,而是返回一个新数组 slice() concat() join() fliter() 阅读全文
posted @ 2022-08-09 16:31 黑白棋学弟 阅读(58) 评论(0) 推荐(0) 编辑
摘要: 方法: newArry.sort(sortBy(‘age’),false) 对应数组.方法(函数名称(排序的属性值),是否升序) 例子: let arr=[ {name:'zopp',age:0}, {name:'gg',age=18}, {name:'zz',age=8} ]; let newAr 阅读全文
posted @ 2022-08-09 16:26 黑白棋学弟 阅读(25) 评论(0) 推荐(0) 编辑
摘要: 1.产生的原因: 给对象添加一个属性,在控制台打印出来,但是却没有更新到视图上时。需要用this.$set()的方法 2.使用方法 调用方法:this.$set(target,key,value) target:要更改的数据源(可以用对象或者数组) key:要更改的具体数据 value:重新赋值 例 阅读全文
posted @ 2022-08-09 16:14 黑白棋学弟 阅读(828) 评论(0) 推荐(0) 编辑
摘要: 解决方法(均在video标签上加属性):ios: webkit-playsinline="true" android: x5-video-player-type="h5" x5-video-player-fullscreen="true" x5-video-orientation="portrain 阅读全文
posted @ 2022-08-09 09:58 黑白棋学弟 阅读(348) 评论(0) 推荐(0) 编辑
摘要: SVG <use>元素可以重用SVG文档中其他位置(包括 <g>元素和 <symbol>元素)的SVG形状。可以在 <defs>元素内部(使形状直到使用之前不可见)或外部定义重用形状。 一、简单案例分析 示例: <!doctype html> <html lang="en"> <head> <met 阅读全文
posted @ 2022-08-08 10:07 黑白棋学弟 阅读(900) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 下一页