![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
vue.js
嫩八
这个作者很懒,什么都没留下…
展开
-
Vue图片预览组件
HTML部分<div class="img-view-wrapper" ref="imgWrapper" style="min-height:300px;"> <i class="el-icon-arrow-left imgIcon pre" :class="{ 'disable': index === 0 }" @click="goPrev()"></i> <i class="el-icon-arrow-right原创 2021-11-16 17:12:38 · 2092 阅读 · 0 评论 -
Vue 上传组件
HTML部分<div class="img-file-row"> <div style="flex:1;"> <div><div class="img-handel"> <el-button type="primary" name="onRemove" @click="onRemove()" v-show="isEditing">删除</el-butt原创 2021-11-16 17:08:38 · 1368 阅读 · 0 评论 -
vue 页面导航组件
快速到达指定的面板。当页面内容太多时,可以用此组件效果图html部分<div class="float-nemu-wrapper"> <span class="el-icon-arrow-left" v-if="!show" @mouseover="more" style="width:30px;height:30px;line-height:30px;background:#7a6e6e;border-radius:2px;color:#fff;vertical-align原创 2021-11-15 14:14:44 · 1260 阅读 · 0 评论 -
js 常用方法,首字母置为大写,克隆,数组转对象,比较对象
首字母置为大写replaceToUpperCase: function (str) { // 首字母置为大写 var reg = /\b(\w)|\s(\w)/g; // \b判断边界\s判断空格 return str.replace(reg, function (m) { return m.toUpperCase() }); },示例代码:var test = ‘abc’;v原创 2021-11-12 13:51:18 · 333 阅读 · 0 评论 -
vue 导入excle,可以预览
导入exclel,数据转成json,可以预览html部分<div> <div> <el-button :disabled="isReadonly" size="mini" type="primary" @click="onImport()">{{ _btnName }}</el-button> <el-button :disabled="isReadonly" v-show="preview&&i原创 2021-11-12 11:06:55 · 365 阅读 · 0 评论 -
vue 事件修饰符
在事件处理程序中调用 event.preventDefault() 或 event.stopPropagation() 是非常常见的需求。尽管我们可以在 events中轻松实现这点,但更好的方式是:methods 只有纯粹的数据逻辑,而不是去处理 DOM 事件细节。为了解决这个问题,Vue.js 为 v-on(@)提供了事件修饰符。通过由点 (.) 表示的指令后缀来调用修饰符。.stop.prevent.capture.self.once...原创 2021-11-12 09:48:19 · 59 阅读 · 0 评论 -
Vue 自定义指令,保留两位位小数的正数
html 部分<el-input v-enterNumberPoint3> </el-input> js部分Vue.directive('enterNumberPoint3', { inserted: function (el, binding) { var trigger = function (el, type) { var e = document.createEvent(原创 2021-11-10 16:19:01 · 578 阅读 · 0 评论 -
vue 控制多个固定不同类型的数字输入框的输入值相加百分比不超过一百(用于计算费率)
v为输入框的值,type为输入框的 idaddressChange: function (v, type) { var _this = this; v = v.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(原创 2021-11-10 16:07:51 · 2088 阅读 · 0 评论 -
h5双击事件失效,模拟双击事件
vue的h5项目,给一元素绑定双击事件dblclick,双击事件dblclick无效不触发解决办法:模拟双击事件dbTest(){ // 全局声明verClickNum = 1, clickTimer = null, lastClickTime = 0; var nowTime = new Date().getTime(); if (nowTime - this.lastClickTime < 300) { /*双击*/原创 2020-10-30 19:52:55 · 1975 阅读 · 1 评论 -
vue.js 封装公用的导出表格方法
//自己内部封装的axios 正常的配置即可import axios from '@/utils/axiosConfig';import { Message } from 'element-ui';/** * * @param {请求路径,请求参数,表格名称,导出的条数} obj */function fileDownLoad(obj) { axios.post( obj.url, obj.param, {responseType: "blob"} ).then(re原创 2020-09-27 17:07:25 · 438 阅读 · 0 评论