会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
pyx204
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
下一页
2021年6月15日
VUE日历组件
摘要: 效果图 源码 <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)
2021年6月10日
vue中使用websocket
摘要: 在data中定义需要的变量 data() { return { websock: '', reconnectTimer: '', // 重连定时器 pageDestroyed: false, // 页面是否销毁 websocketIsJump: false, // websocket 心跳是否正常
阅读全文
posted @ 2021-06-10 16:14 pyx204
阅读(455)
评论(0)
推荐(0)
2021年6月8日
某元素滚动到网页可视范围内
摘要: 方法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)
2021年5月26日
vue下拉选择组件
摘要: 可以实现多选,联想搜索(仅单选支持) 功能展示 可联想搜索的单选 多选 使用介绍 支持从父组件传的参数有 '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个月后
摘要: // 计算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)
计算某日期N天前(后)的日期
摘要: // 某日期向前/向后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)
2020年11月20日
input框只允许输入单价
摘要: <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)
上一页
1
2
3
4
5
下一页
公告