![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
前端
保持微笑ヽ继续我旳骄傲
这个作者很懒,什么都没留下…
展开
-
element 时间日期选择器,设置最多可选择范围为一个月或者不能跨月选择范围
<el-date-picker v-model="time" type="datetimerange" @change="datePickerChange" :picker-options="pickerOptions" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" ...原创 2021-10-09 14:54:41 · 2999 阅读 · 0 评论 -
day.js 将时间转换为年月日时分秒
安装npm install dayjs --save想要使用的页面引入var dayjs = require('dayjs')var dayjsTime = dayjs(`${new Date()}`).format('YYYY-MM-DD HH:mm:ss') // new Date() 换成自己需要转换的数据 console.log(dayjsTime) // 2019-10-12 15:19:28...原创 2021-09-14 15:59:27 · 3891 阅读 · 0 评论 -
Mon Sep 13 17:12:54 CST 2021 时间转年月日时分秒 yyyy/MM/dd hh:mm:ss
// 时间处理 processTime(value) { // 比如 Mon Sep 13 17:12:54 CST 2021 var format = 'yyyy/MM/dd hh:mm:ss' var date = new Date(value) // let d = new Date(date); const d = new Date(date.valueOf() - 60 * 60 * 1000 * 14) //.原创 2021-09-14 10:17:07 · 1338 阅读 · 0 评论 -
js手机号中间几位*****
这是一个js方法export default function(tel) { var reg = /^(\d{3})\d{4}(\d{4})$/ return tel.replace(reg, '$1****$2')}在需要的地方调用import formatTel from ‘./utils/formatTel.js’console.log(formatTel(‘18767569008’)) // 187****9008...原创 2021-08-13 16:31:57 · 114 阅读 · 0 评论 -
js随机生成密码(有3种类型的)
1. 写一个js文件// 随机密码,数字,字母下划线,大小写都有export function complexPsw(min, max) { // 可以生成随机密码的相关数组 var num = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] var english = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q',原创 2021-08-13 16:27:24 · 2155 阅读 · 0 评论 -
js手机号验证
if (!/^1[3456789]\d{9}$/.test(this.phone)) { // this.phone是用户输入的 return this.$message.error('请输入正确的手机号') }原创 2021-08-13 16:06:12 · 105 阅读 · 0 评论 -
js姓名除了姓,名*** 或者除了姓名最后一个字,剩余的**
// 姓名格式化 formatName(str) { if (str) { return str.substr(0, 1) + new Array(str.length).join('*') } }, formatName('王欻欻') // 王**原创 2021-08-13 16:03:43 · 473 阅读 · 0 评论 -
删除对象里面的指定属性字段
var obj={ name: 'zhagnsan', age: 19 }delete obj.name //true 删除字段nametypeof obj.name //undefined 查看字段name的数据类型原创 2021-08-13 11:59:18 · 681 阅读 · 0 评论 -
获取验证码倒计时
<!-- 可以点击 --> <button type="warning" v-if="isGetCode" class="getCode" style="width:40%" round @click="getSendPhoneMessage" size="mini" id="getcode">获取验证码</button> <!-- 不可以 -->..原创 2021-04-16 11:30:08 · 61 阅读 · 0 评论 -
获取当前时间的年、月、日、时间等
JS获取当前时间的年、月、日、时间等var date = new Date();date .getYear(); //获取当前年份(2位)date .getFullYear(); //获取完整的年份(4位)date .getMonth(); //获取当前月份(0-11,0代表1月)date .getDate(); //获取当前日(1-31)date .getDay(); //获取当前星期X(0-6,0代表星期天)date .getTime(); //获取当前时间(从1970.1.1原创 2021-04-13 17:43:40 · 2066 阅读 · 0 评论 -
video 标签视频手动播放
// controls="controls" 主要在他<video src="视频地址" controls="controls" style="width:200px;height:100px;margin-right:20px;"></video>原创 2021-04-01 17:40:13 · 986 阅读 · 0 评论 -
vue 上传文件给后端
1. 封装的视频上传组件<div class="videoBox"> <input class="input" ref="uploader" @change="onFileChange" type="file" :accept="accept" :multiple="multiple"> <label ref="uploaderlabel" style="cursor: pointer;"> <slot>原创 2021-04-01 11:17:07 · 1521 阅读 · 0 评论 -
vue 获取图片宽高
// url是本地图片地址或者线上图片地址: 本地:blob:http://localhost:8080/d854a38b-275b-4c36-b65d-be705a2458e7 getImageSize(url) { return new Promise((resolve) => { var img = document.createElement("img"); img.src = url;原创 2021-04-01 10:35:11 · 1095 阅读 · 0 评论 -
vue : 无法加载文件 C:\Users\xxx\AppData\Roaming\npm\vue.ps1,因为在此系统上禁止运行脚本
一、问题描述 使用命令npm install vue-cli -g安装脚手架之后,创建Vue项目vue init webpack demo 提示“无法加载文件 C:\Users\xxx\AppData\Roaming\npm\vue.ps1,因为在此系统上禁止运行脚本”二、解决方法转到“开始”菜单,然后搜索“ Windows PowerShell ISE”。右键单击x86版本,然后选择“以管理员身份运行”。在顶部,粘贴Set-ExecutionPolicy RemoteSigned ; 运行脚本原创 2020-10-27 15:43:51 · 728 阅读 · 0 评论 -
微信H5,判断是否在微信浏览器中打开(uniapp)
在app.vue里写上判断 onShow: function() { var ua = navigator.userAgent.toLowerCase(); var isWeixin = ua.indexOf('micromessenger') != -1; if (!isWeixin) { window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+this.$appid; /原创 2020-09-07 17:44:20 · 2815 阅读 · 1 评论 -
删除线和下划线,文字的间隔
text { text-decoration:underline; /*下划线 */ text-decoration: line-through; /* 删除线 */ }原创 2020-07-27 11:34:34 · 176 阅读 · 0 评论