02 2021 档案
摘要:实现上图所示的轮播图的效果html: <div class="swiper-scale-wrap"> <van-swipe class="swiper-block" :loop="true" :width="160" @change="onChange"> <van-swipe-item class
阅读全文
摘要:因为因为网络原因导致的node-modules的部分文件缺失,在npm install 时报错如下: 但此时有node-modules,启动项目会报:Error: Cannot find module 'node-sass'解决方法如下: 1. npm install -g cnpm --regis
阅读全文
摘要:WXML:<view class="form-item left-class" @click="hanleOpenWeek"> <view class="label">周时间</view> <view class="mid-block">{{ info.weekTime | filterWeekTi
阅读全文
摘要:const list = [{type: "string", value: "字符串一"}, {type: "string", value: "字符串二"}, {type: "string", value: "字符串三"}]const newList = []list.forEach(arg =>
阅读全文
摘要:const obj = { number: 100 }const { number } = obj//使用别名const { number: otherNumber } = objconsole.log(otherNumber) // 100
阅读全文
摘要:一、数组合并去重 例:let arr1 = [1, 2,3, 4, 5, 7] let arr2 = [1, 3, 5, 7,8, 10] let arr = arr1.concat(arr2) -> 合并数组 let newArr = [...new Set(arr)] 或者:let newArr
阅读全文
摘要:一、数字转字符串 1. toString()方法 例: let arr = [1, 2, 3] let str = arr.toString() console.log(str) // 1, 2, 3 2. join()方法 -> 可以指定分隔符(如果省略参数,则默认为逗号) 例: let arr
阅读全文
摘要:当想要img的src值为空时想要去掉边框:img[src=""], img:not([src]){opacity: 0}
阅读全文
摘要:当eslint 报 长度限制的警告时,可以将其设置不限制 1. 找到 tslint.json/eslint.json文件 2. 在rules中添加"max-line-length": false rules: { .... "max-line-length": false, .... }
阅读全文
摘要:.multiple-lines-ellipsis{ overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 5; /*! autoprefixer: ignore next */ //
阅读全文