摘要: 1. components文件夹下新建tabar组件 <template> <view> <u-tabbar :value="current?current:0" @change="changeTab" :fixed="true" :placeholder="false" :safeAreaInse 阅读全文
posted @ 2022-05-19 17:54 是你吗我笑了 阅读(3750) 评论(0) 推荐(0) 编辑
摘要: <el-input @input="handleInput($event)"></el-input> methods: { handleInput(e) { this.$forceUpdate() } } 阅读全文
posted @ 2022-05-17 18:47 是你吗我笑了 阅读(119) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2022-02-16 15:08 是你吗我笑了 阅读(413) 评论(0) 推荐(0) 编辑
摘要: let a = [1,2,3,7,8,9] let b = [4,5,6] let insertIndex = 3 a.splice.apply(a,Array.prototype.concat(insertIndex,0,b)) //[1,2,3,4,5,6,7,8,9] 阅读全文
posted @ 2022-02-08 18:31 是你吗我笑了 阅读(136) 评论(0) 推荐(0) 编辑
摘要: const arr = ['a','b',null,undefined,'c','','d'] arr.filter(Boolean) //['a','b','c','d'] 阅读全文
posted @ 2022-02-08 11:56 是你吗我笑了 阅读(102) 评论(0) 推荐(0) 编辑
摘要: const arr = [3,2,4,6,5,8] //从小到大 arr.sort((a,b) => a-b) //[2,3,4,5,6,8] //从大到小 arr.sort((a,b) => b-a) //[8,6,5,4,3,2] 阅读全文
posted @ 2022-02-08 11:23 是你吗我笑了 阅读(86) 评论(0) 推荐(0) 编辑
摘要: const arr = [4,5,6,7,8] //求和 const sum = arr.reduce((a,b) => a+b) //30 //最小值 const min = arr.reduce((a,b) => a > b ? b : a) //4 //最大值 const max = arr. 阅读全文
posted @ 2022-02-08 11:12 是你吗我笑了 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 1 const num = 1000000; 2 //整数部分每三位追加一个逗号 3 num.toLocaleString(); //1,000,000 4 //转换为百分比 5 num.toLocaleString("zh", { style: "percent" }); // 100000000 阅读全文
posted @ 2022-02-07 18:19 是你吗我笑了 阅读(110) 评论(0) 推荐(0) 编辑
摘要: let arr = [1,2,[3,4,[5,6,[7,8,[9]]]]] //flat()默认拉平1层,如果不管有多少层嵌套都要拉平为一维数组,用Infinity关键字作为参数 let newArr = arr.flat(Infinity) 阅读全文
posted @ 2022-02-07 17:25 是你吗我笑了 阅读(23) 评论(0) 推荐(0) 编辑
摘要: Object.keys(obj).forEach(key => { obj[key] = '' }) 阅读全文
posted @ 2022-01-26 11:20 是你吗我笑了 阅读(60) 评论(0) 推荐(0) 编辑