摘要: 效果图 源码 <template> <div class="calendar-wrapper"> <!-- 月份变换区 --> <div class="header rowJcAc" v-if="headerBar"> <div class="arrowIcon rowJcAc" @click="c 阅读全文
posted @ 2021-06-15 09:57 pyx204 阅读(623) 评论(0) 推荐(0)
摘要: 在data中定义需要的变量 data() { return { websock: '', reconnectTimer: '', // 重连定时器 pageDestroyed: false, // 页面是否销毁 websocketIsJump: false, // websocket 心跳是否正常 阅读全文
posted @ 2021-06-10 16:14 pyx204 阅读(455) 评论(0) 推荐(0)
摘要: 方法1:写一个隐藏的input框,让input聚焦,滚动条自动会滚到input所在位置 <input type="text" ref="input"/> this.$refs.input.focus() 方法2: 用scrollIntoView() <div ref="box"></div> thi 阅读全文
posted @ 2021-06-08 15:35 pyx204 阅读(63) 评论(0) 推荐(0)
摘要: 可以实现多选,联想搜索(仅单选支持) 功能展示 可联想搜索的单选 多选 使用介绍 支持从父组件传的参数有 'redBorder','width','height','placeholder','optionList','selectOption','multiple','color','confli 阅读全文
posted @ 2021-05-26 18:08 pyx204 阅读(1566) 评论(0) 推荐(0)
摘要: 有两个数组 var arr1 = [1,2,4,6,8] var arr2 = [3,3,5,6] 合并成 [1,2,3,3,4,5,6,6,8] 思路: 因为两个都是有序数组,所以从两个数组的最后一项开始依次向前做比较 方法1: newArrFun(arr1,arr1.length,arr2,ar 阅读全文
posted @ 2021-05-26 14:40 pyx204 阅读(393) 评论(0) 推荐(0)
摘要: // 手机正则 checkPhone(phone){ return /^1[3456789]\d{9}$/.test(phone); }, 阅读全文
posted @ 2021-05-26 11:44 pyx204 阅读(45) 评论(0) 推荐(0)
摘要: // 计算年龄 computedAge(day) { var r = day.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})/); if (r == null) return false; var d = new Date(r[1], r[3] - 1, r[ 阅读全文
posted @ 2021-05-26 11:42 pyx204 阅读(220) 评论(0) 推荐(0)
摘要: // 计算n个月后 date格式:2020-11-12 若输入的日期N个月后有那一天则,直接返回否则返回N个月后的第一天 如:输入(2021-01-12,1),返回 2021-02-12 ;若输入(2021-01-31,1) 则返回 2021-02-28 addmulMonth(date,n){ v 阅读全文
posted @ 2021-05-26 11:39 pyx204 阅读(97) 评论(0) 推荐(0)
摘要: // 某日期向前/向后num天 jumpNumDay(date,num) { return new Date(date.getTime()+(num*24*60*60*1000)) }, // 转换日期 changeDate(date) { return date.getFullYear()+'-' 阅读全文
posted @ 2021-05-26 11:24 pyx204 阅读(400) 评论(0) 推荐(0)
摘要: <input type="text" class="defaultInput smInput" v-model="row.row.unitPrice" @input="onlyPrice(row.$index)" @change="alterRecord(row.row)"> // 返回单价(不为负 阅读全文
posted @ 2020-11-20 10:01 pyx204 阅读(135) 评论(0) 推荐(0)