摘要: Vue版本:npm install html5-qrcode <template> <div class="index"> <!-- 扫一扫 --> <div class="scan" v-if="isScanning"> <div class="scan-box"> <div id="scanni 阅读全文
posted @ 2023-04-13 18:51 李健威 阅读(6265) 评论(0) 推荐(0)
摘要: function deleteChar(str, n) { var num = -1 return str.replace(/a/g, item => { num++; return num == n ? '' : item }) } deleteChar("12 a 3 4 a 45 8a 768 阅读全文
posted @ 2022-12-30 18:19 李健威 阅读(101) 评论(0) 推荐(0)
摘要: function getStrLen(str) { var charObj = {}; str.replace(/\S/g, function(l){charObj[l] = (isNaN(charObj[l]) ? 1 : charObj[l] + 1);}); return charObj; } 阅读全文
posted @ 2022-12-30 17:15 李健威 阅读(444) 评论(0) 推荐(0)
摘要: ::-webkit-scrollbar 滚动条整体部分 ::-webkit-scrollbar-thumb 滚动条里面的小方块,能向上向下移动(或往左往右移动,取决于是垂直滚动条还是水平滚动条) ::-webkit-scrollbar-track 滚动条的轨道(里面装有Thumb) ::-webki 阅读全文
posted @ 2022-11-30 10:42 李健威 阅读(1520) 评论(0) 推荐(0)
摘要: 1 Array.prototype.myReduce = function (f, v) { 2 let sum = v || this[0] || 0 3 let curIndex = v ? 0 : 1 4 for (let i = curIndex; i< this.length; i++) 阅读全文
posted @ 2022-06-07 15:24 李健威 阅读(32) 评论(0) 推荐(0)
摘要: let arr = [1,2,3,4,5] arr.sort(() => { return 0.5 - Math.random() }) console.log(arr) // [4,2,1,3,5] 阅读全文
posted @ 2021-12-28 18:06 李健威 阅读(38) 评论(0) 推荐(0)
摘要: 1 <!DOCTYPE html> 2 <html lang="zh"> 3 <head> 4 <title>代码对比/归并title> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <meta h 阅读全文
posted @ 2021-12-10 21:41 李健威 阅读(245) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv 阅读全文
posted @ 2021-11-13 23:20 李健威 阅读(89) 评论(0) 推荐(0)
摘要: 方法一:(用定义id的方式) // html部分 <view class="store-dialog" @click="clickStoreDialogMark" id="storeDialog"> <view class="store-info" id="storeInfo"> 商城信息 </vi 阅读全文
posted @ 2021-09-24 11:14 李健威 阅读(2463) 评论(0) 推荐(0)
摘要: // 等差数列求和法function sumArea (first, last) { return (first + last) * (last - first + 1) / 2 }sumArea(1,100) // 5050sumArea(200,300) // 25250 // 循环求和法fun 阅读全文
posted @ 2021-09-22 18:26 李健威 阅读(601) 评论(0) 推荐(0)