会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
是你吗我笑了
博客园
首页
新随笔
联系
订阅
管理
2022年5月19日
uniapp 使用 uview 自定义tabbar
摘要: 1. components文件夹下新建tabar组件 <template> <view> <u-tabbar :value="current?current:0" @change="changeTab" :fixed="true" :placeholder="false" :safeAreaInse
阅读全文
posted @ 2022-05-19 17:54 是你吗我笑了
阅读(4352)
评论(0)
推荐(0)
2022年5月17日
Vue el-input不能输入内容
摘要: <el-input @input="handleInput($event)"></el-input> methods: { handleInput(e) { this.$forceUpdate() } }
阅读全文
posted @ 2022-05-17 18:47 是你吗我笑了
阅读(138)
评论(0)
推荐(0)
2022年2月16日
js字符串前加空格
摘要: <!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 是你吗我笑了
阅读(466)
评论(0)
推荐(0)
2022年2月8日
将一个数组插入到另一个数组指定位置
摘要: 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 是你吗我笑了
阅读(164)
评论(0)
推荐(0)
数组过滤null,undefined,空字符串
摘要: const arr = ['a','b',null,undefined,'c','','d'] arr.filter(Boolean) //['a','b','c','d']
阅读全文
posted @ 2022-02-08 11:56 是你吗我笑了
阅读(112)
评论(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 是你吗我笑了
阅读(126)
评论(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 是你吗我笑了
阅读(37)
评论(0)
推荐(0)
2022年2月7日
toLocaleString()使用
摘要: 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 是你吗我笑了
阅读(133)
评论(0)
推荐(0)
js数组扁平化
摘要: 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 是你吗我笑了
阅读(25)
评论(0)
推荐(0)
2022年1月26日
快速将对象的键赋值为空
摘要: Object.keys(obj).forEach(key => { obj[key] = '' })
阅读全文
posted @ 2022-01-26 11:20 是你吗我笑了
阅读(62)
评论(0)
推荐(0)
公告