01 2022 档案
vue 单选-多选
摘要:#1、代码 <div v-for="(item, index) in list" :key="index"> <div> 问题:{{ index + 1 }}、{{ item.title }} <span v-if="item.state 'single'">(单选)</span> <span v-
阅读全文
css 滚动条美化
摘要:#1、css ::-webkit-scrollbar { width: 6px; height: 6px; background-color: #f5f5f5; } /*滚动条 阴影~圆角*/ ::-webkit-scrollbar-track { -webkit-box-shadow: inset
阅读全文
vue 过滤查询(计算属性 computed)
摘要:#1、结构 <template> <div class="Ling"> <input type="text" v-model="searchValue" /> <div v-for="(item, index) in personInfoListSearch" :key="index"> {{ it
阅读全文
数组排序
摘要:#1、数组 var demo = [ { value: 26 }, { value: 29 }, { value: 30 }, { value: 31 }, { value: 22 }, { value: 20 } ]; #2、方法 function compareFunc(field) { ret
阅读全文
格式化日期
摘要:#1、方法 const formatDate = (date, format = "YYYY-MM-DD HH:mm:ss") => { if (!date) { return ""; } const d = new Date(date); // 年 if (/YYYY/.test(format))
阅读全文
数字千位符
摘要:#1、方法 const formatThousand = data => { let type = Object.prototype.toString.call(data); if (type "[object Number]") { return data .toString() .replace
阅读全文
VUE 判断数据类型
摘要:#1、方法 <!-- * @Descripttion: 类型判断 * @version: 0.0.1 * @Author: PengShuai * @Date: 2022年04月29日11:21:14 * @LastEditors: PengShuai * @LastEditTime: 2022年0
阅读全文
JS 数组对比去重
摘要:#1、两个数组通过唯一编码进行比较 /** * 根据某一属性找出差异 * @param {arry} arr1 第一个参数需要对比的数组 * @param {arry} arr2 第二个参数需要对比的数组 * @param {string} fildId 需要对比的属性 * @returns 返回有
阅读全文
新老数据对比
摘要:判断新数据与原始数据中有何不同(增删改) const formatSaveList = (newList, oldList) => { const insertList = []; const deleteList = []; const updateList = []; // 找到新增和修改 ne
阅读全文
vue 消息推送 WebSocket
摘要:#1、创建WebSocket.js文件 #2、设置链接 const url = "localhost:8080" #3、方法 class WebSocketClass { constructor() { this.instance = null; this.connect(); } static g
阅读全文
日历
摘要:#1、布局 <template> <div class="WorkCanlender"> <div class="content not-select" @mouseup="endMove"> <div class="calendBox day" v-for="(item, index) in ca
阅读全文
element-ui 弹窗实现拖拽
摘要:#1、组件部分 <el-dialog v-dialogDrag ref="xhzqDialog" class="xhzqDialog" :title="title" :fullscreen="isfullscreen" :visible.sync="dialogVisible" :append-to
阅读全文