随笔分类 - javascript
js 数组对象中每一项对象属性比较大小与计算数组对象属性和及其它校验方法
摘要:// 数组对象排序方法 compare(property) { return function (a, b) { const value1 = a[property] const value2 = b[property] return value2 - value1 // 正序 return val
阅读全文
js正则相关验证
摘要:// 汉字检测 export function validChinese(value) { return /^([\u4e00-\u9fa5]{0,}$)/.test(value) } // 有1~3位小数的正实数 export function validNumber(value) { retur
阅读全文
vue+ DatePicker日期的加减
摘要:<template> <div style="margin:10px;"> <el-card> <el-date-picker v-model="boothDate" type="date" style="margin-bottom:20px;" placeholder="选择日期" value-f
阅读全文
获取当前日期前一个月日期与天数数组
摘要:计算当前日期前一个月日期: 1、getThrityMonth(){ var thrityMonth = [] for(var i = 0;i<30;i++){ thrityMonth.unshift(new Date(new Date() .setDate(new Date().getDate()-
阅读全文
Vue中使用android和ios手机打开相机并选择相册功能和图片旋转问题
摘要:<template> <div> <input type="file" id="fileElem" accept="image/*" @change="chooseImg" ref="imgFile"/> //使用的vant插件 <van-action-sheet v-model="showCame
阅读全文
js正则表达身份证姓名和身份证号码
摘要:<div style="margin:.4rem;"> <p class="secondTitle">请输入身份证上的姓名:</p> <van-field v-model="cardName" clearable ref="cardName"></van-field> </div> <div sty
阅读全文
浙公网安备 33010602011771号