elemnet ui pickerOptions 获取限制月份日期选择; 第一种方法:根据接口返回日期限制,只能选择开始日期到结束日期范围内的。 <el-date-picker type="monthrange" :disabled="!isEdit" v-model="formData.effectPeriod" @change="handleChangeEffectStart" :picker-options="picker.
多数组、字段表单验证判断是否必填 第一类:多数组、多模块表单判断;let DetailList = ["vipId", "vipName"];this.checkFormTable1( this.detail_option_data, //数据来源数组 "activityRuleDtoList", // 要判断this.detail_option_data 数组里面的数组名称 "xxx等级", //message 提示的名称 DetailList ..
vue-pdf 预览和下载 极简模式:pdf 预览 handelDownload(row) { this.$axios({ method: "get", url: baseUrl + getUrl, responseType: "arraybuffer", header: { "Content-Type": "multipart/form-data" }, params: { billId: row.id,...
tinymce 富文本编辑以及图片上传功能 <template> <textarea :id="tinymceId" style="visibility: hidden"> </textarea></template><script>import loadTinymce from "@/utils/loadTinymce";import { plugins, toolbar } from "./config";import { debounce } from "thrott.
vue 复制、打印 插件 <el-button v-print="'#printSearch'">打印</el-button>//打印组件import Print from "vue-print-nb";Vue.use(Print); <div class="icon-document-copy" v-clipboard:copy="orderNo" v-clipboard:success="onCopy" v-clipboard..
this.$options.data().option.column 避免数据污染 let t1 = {label: "费用合计",prop: "costTotal",width: 100,};this.option.column = this.$options.data().option.column.concat(this.settlementList_Data, t1);
JavaScript代码片段——数组篇 1). compact去除数组中的无效值false, null,0, "", undefined, 和 NaN 都是被认为是“假值”。const compact = arr => arr.filter(Boolean)2).difference 数组差集const difference = (a, b) => { const s = new Set(b) let arr = a.filter(x => !s.has(x)) return arr}differe.
vue列表合计计算 :summary-method :summary-method="summaryMethod" summaryMethod({ columns, data }) { const sums = []; if (columns.length > 0) { columns.forEach((column, index) => { if ([6].includes(index)) { sums[index] = "合计"; ..
解决table 修改size后,查看表格间距错乱的问题; if (!this.isEdit) {this.tableData = this.$nextTick(() => {this.$refs.tableData.doLayout();});}
:summary-method=“summaryMethod“ table 合计 summaryMethod({ columns, data }) {const sums = [];if (columns.length > 0) {columns.forEach((column, index) => {if ([6].includes(index)) {sums[index] = "合计";} else if (["shopCode","contractId","instrumentNo","category","type",
本地localStorage.setItem let userCache = { content:this.userInfo,dataType : 'string' , datetime : new Date().getTime()}localStorage.setItem('avue-userInfo', JSON.stringify(userCache));
表单验证watch watch方式<el-form-item prop="yt_code1" :rules="yt_code1"> "formData.type": { handler: function handler() { if(this.formData.type=='Y'){ this.rules.certificate_no[0].required=true; this.rules.certificate_no.
! [rejected] master -> master (non-fast-forward) 因为远程仓库和本地仓库文件冲突,使用git pull --rebase origin master发现有问题只能回退到使用命令:git rebase --abort 回退
element-ui table 默认全选功能实现; methods: { checked() { const that=this console.log(that.goodsList) that.$nextTick(() => { for (let i = 0; i <that.goodsList.eList.length; i++) { that.$refs.listPowerSupplyTab.toggleRowSelection( ...
URL 拆解问题 /** * --- 题目描述 --- * * 实现一个 parseParem 函数,将 url 转化为指定结果 * * --- 测试用例 --- * * 输入:url = 'http://www.domain.com/?user=anonymous&id=123&id=456&city=%E5%8C%97%E4%BA%AC&enabled' * 输出:{ user:'anonymous', id:[123,456],// 重复出现的 key 要组装成数组
JavaScript 的奇葩知识 (1)const arr = [1, 2, 3];// 存在,等效于 > -1if (~arr.indexOf(1)) {}// 不存在,等效于 === -1!~arr.indexOf(1);(2)function fn1() { console.log(1);}function fn2() { console.log(2);}fn1.call.call(fn2); // 2所以 fn1.call.call(fn2) 等效于 fn2.call(undefine
JavaScript 冒泡排序 var arr=[1,3,6,5,4,10,0,9]function bubbleSort (arr) { var max = arr.length - 1; for (var j = 0; j < max; j++) { // 声明一个变量,作为标志位 var done = true; for (var i = 0; i < max - j; i++) { if (arr[i] > arr[i + 1]) { var temp