随笔分类 - Vue中常用组件
摘要:async export_data() { let zip = new JSZip() // 下载文件并添加到 ZIP for (const i of this.tableData) { const data = await fetch(i.path).then(response => respon
阅读全文
摘要:<template> <div> <el-upload ref="upload" class="upload-demo" action="#" accept="xlsx,xls" multiple :limit="1" :auto-upload="false" :withCredentials="f
阅读全文
摘要:1、el-table添加span-method <el-table :data="table_data" id="out-table" :span-method="objectSpanMethod" style="width: 100%"> ... </el-table> 2、合并的方法 // 合并
阅读全文
摘要:1、安装:npm install html2canvas jspdf --save 2、创建:html2canvas.js 文件,内容如下: import html2Canvas from 'html2canvas' import JsPDF from 'jspdf' /** * @param {S
阅读全文
摘要:公共: @blur="send_data.num = $event.target.value ? Number($event.target.value) : null" 不能输入小数点:oninput="value=value.replace(/[^\d]/g,'')" 可输入小数点:oninput
阅读全文
摘要:前提:getTableMaxHeight.js /** * @param {Number} difference_height 需要减去的值 * @return {Number} table的最大高度值 */ function getTableMaxHeight(difference_height)
阅读全文
摘要:/* eslint-disable */ let idTmr; const getExplorer = () => { let explorer = window.navigator.userAgent; //ie if (explorer.indexOf("MSIE") >= 0) { retur
阅读全文
摘要:this.$refs['multipleTable'].bodyWrapper.scrollTop = 0 // 顶部 this.$refs['multipleTable'].bodyWrapper.scrollTop = this.$refs['multipleTable'].bodyWrappe
阅读全文
摘要:/** * 功能:对比两个纯数组之间的数据差异 * @param {source_data} sourceData 原始数据(必选) * @param {String} newData 更新后的数据(必选) * @return {Array} 返回的 add_data, delete_data,更新
阅读全文
摘要:/** * @param {Array} sourceData 原始数据(必选) * @param {String} keyName 单条数据中的唯一标识符字段名(必选) * @param {String} parentKeyName 单条数据中的上级唯一标识符的字段名(必选) * @return
阅读全文
摘要:/** * @param {Array} dataList 完整数据(必传) * @param {Sting/Int} keyName 对哪个字段进行与targetID对比(必传) * @param {Sting/Int} targetID 目标数据的唯一标识符(必传) * @param {Stin
阅读全文
摘要:1、只能输入数字: onkeyup="value = value.replace(/[^\d]/g,'')" 2、只能输入英文:onkeyup="value = value.replace(/[^a-zA-Z]/g,'')"
阅读全文
摘要:1、创建ExportExcel.vue组件 <template> <div class="export_tools"> <div v-show="false"> <el-table id="out-table" style="width: 100%;" :data="exportTable"> <t
阅读全文
摘要:<template> <div class="main"> <div class="left_main" :class="{ left_main_show: openStatus }"> <el-menu id="elmenu" background-color="#545c64" text-col
阅读全文
摘要:getSearchInfo() { let search = this.search if (search) { this.currpage = 1 this.currentPage = 1 return this.tableData.filter(data => { return Object.k
阅读全文
摘要:1 <template> 2 <div> 3 <el-button style="float:left;margin-left:20px;" type="primary" @click="add_dialogVisible = true" 4 >新增用户</el-button 5 > 6 <el-t
阅读全文
摘要:// 根组件/父路由 <template> <div class="layout"> <el-container> <el-header> 头部代码 </el-header> <el-main> <router-view v-if="isRouterAlive" /> </el-main> </el
阅读全文