摘要: let arr = [1, 2, [99, 100], 3, 4, [1, 2, { name: 'hkq' }, [[1, 2, 3], 2]], 5, 6, 7, 8] let c = arr.flat(Infinity) // Infinity 表示展开任意胜读的嵌套数组 可以是 0, 1, 阅读全文
posted @ 2022-10-26 09:53 牧羊少年& 阅读(94) 评论(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-10-09 16:00 牧羊少年& 阅读(99) 评论(0) 推荐(0)
摘要: 可选链 ?. let name let info = { name: '2323' } info = null // info = undefined // info = '' name = info?.name || '张三'; // 效果和下面 if 一样 if (info && info.na 阅读全文
posted @ 2022-09-16 14:38 牧羊少年& 阅读(18) 评论(0) 推荐(0)
摘要: // 数组使用 let arr = [1, 5, 7] let a = 7 let bool = arr.includes(a) console.log('bool: ', bool); // true a 等于 1、5、7 bool 都为true // 用法简写 一个元素多个值 if判断 if ( 阅读全文
posted @ 2022-09-16 14:12 牧羊少年& 阅读(106) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-07-07 19:26 牧羊少年& 阅读(129) 评论(0) 推荐(0)
摘要: let obj = {} let k = '' for (k in obj) { } if (!k) { console.log('空对象'); } else { console.log('非空对象'); } let num = Object.keys(obj).length if (num) { 阅读全文
posted @ 2022-06-30 13:06 牧羊少年& 阅读(54) 评论(0) 推荐(0)
摘要: let y = new Date().getFullYear() let m = new Date().getMonth() + 1 let lastDay = new Date(y, m, 0).getDate() console.log('lastDay: ', lastDay); // las 阅读全文
posted @ 2022-05-26 13:50 牧羊少年& 阅读(888) 评论(0) 推荐(0)
摘要: html 部分 <el-input v-model="addForm.count" type="text" @input="changeInput" /> js 部分 changeInput(str) { let pattern = /^[1-9][0-9]*$/ // 正整数的正则表达式 // 不 阅读全文
posted @ 2022-02-12 21:11 牧羊少年& 阅读(1309) 评论(0) 推荐(0)
摘要: 转载:https://blog.csdn.net/lfl976/article/details/104894147 阅读全文
posted @ 2022-02-10 13:35 牧羊少年& 阅读(210) 评论(0) 推荐(0)
摘要: 转自:https://www.cnblogs.com/jane2160/p/11358166.html 如何自定义小程序: https://blog.csdn.net/u011043997/article/details/85248697 阅读全文
posted @ 2022-01-04 14:50 牧羊少年& 阅读(74) 评论(0) 推荐(0)