- 博客(7)
- 收藏
- 关注
原创 2021-06-29
元素鼠标缩放自定义指令import Vue from 'vue'// import _ from 'lodash'// 缩放容器设置let containerScale = { init: 1, // 初始倍率 min: 0.2, // 最小倍率 max: 3, // 最大倍率 onceNarrow: 0.05, // 每次缩放比率 onceEnlarge: 0.05 // 每次缩放比率}// 缩放样式配置let container = { scale: 1, //
2021-06-29 10:25:52
127
原创 2021-06-29
输入框指令,支持字节数限制;特殊字符禁止输入;特殊正则验证及回调/** * maxLength Number 限制字节长度 * specailCharRestrict Boolean 是否限制特殊字符输入,默认true * letter Boolean 是否限制英文字母输入,默认false * regExp Regexp 传入正则,失去焦点触发验证 * errorCb Function 失败回调 */import Vue from 'vue'const SPC_CH
2021-06-29 10:21:36
132
原创 2021-06-29
自定义指令元素拖拽import Vue from 'vue'Vue.directive('dialogDrag', { bind (el, binding, vnode, oldVnode) { // const dialogHeaderEl = el.querySelector('.el-dialog__header') // const dragDom = el.querySelector('.el-dialog') const dragDom = el // d
2021-06-29 10:17:40
121
原创 2021-06-29返回上一页
有关返回上一页go和back的区别go:this.router.go(−1)后退+刷新this.router.go(-1) 后退+刷新this.router.go(−1)后退+刷新this.router.go(0) 刷新this.router.go(1)前进back:this.router.go(1) 前进back:this.router.go(1)前进back:this.router.back() 后退this.router.back(0)刷新this.router.back
2021-06-29 10:08:46
110
原创 处理二进制流文件
处理接口返回二进制流文件// res 接口返回的二进制文件流// const blob = new Blob([res])// UTF-8国际化 中文乱码 const blob = new Blob(["\ufeff" + res], { type: "text/csv,charset=UTF-8" }); if ('download' in document.createElement('a')) { const elin
2021-04-20 17:17:05
206
原创 常用正则
正整数:/^\d*$/大于0的整数:/^[1-9]\d*$/大于0的数(包括小数):/^([1-9]\d*(\.\d*[1-9])?)$|^(0\.\d*[1-9])$/大于等于0的数: /^([1-9]*\d*(\.\d*[1-9])?)$|^(0\.\d*[1-9])$/数字(包括小数正负):/^(\-?)\d+(\.\d+)?$/IP: /^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|...
2021-04-14 15:48:19
176
原创 vue自定义组件全局注册
vue自定义组件全局注册----(vue.use() )install的使用在vue项目中我们可以自定义组件,通过install全局注册1、首先创建一个index.vue文件ps:<template> <div class="btn-wrapper"> <el-button :class="['btnItem',item.class]" v-for="(item, index) in btnConfig"
2020-09-03 18:57:33
315
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅