随笔分类 -  JS

摘要:!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).uni 阅读全文
posted @ 2025-07-15 19:23 DL·Coder 阅读(28) 评论(0) 推荐(0)
摘要:!function(e,n){"function"==typeof define&&(define.amd||define.cmd)?define(function(){return n(e)}):n(e,!0)}(this,function(r,e){var a,c,n,i,t,s,d,o,l,u 阅读全文
posted @ 2025-07-15 19:23 DL·Coder 阅读(26) 评论(0) 推荐(0)
摘要:解决文章:点我 阅读全文
posted @ 2024-10-21 17:19 DL·Coder 阅读(30) 评论(0) 推荐(0)
摘要:html 头像UI <button class="user-avatar flex-center" open-type="chooseAvatar" @chooseavatar="onChooseAvatar"> <image class="img" :src="showAvatat()" mode 阅读全文
posted @ 2024-09-03 11:32 DL·Coder 阅读(704) 评论(0) 推荐(0)
摘要:import SockClient from 'sockjs-client' const Stomp = require('@stomp/stompjs') // 方法 createStompClient() { const that = this const ws = new SockClient 阅读全文
posted @ 2023-05-18 18:20 DL·Coder 阅读(2589) 评论(0) 推荐(0)
摘要:getQueryParams() { const paramsString = new URLSearchParams(window.location.search).toString(); // 将查询字符串转换为字符串 const paramsArray = paramsString.split 阅读全文
posted @ 2023-05-16 11:56 DL·Coder 阅读(128) 评论(0) 推荐(0)
摘要:function formatSeconds(time) { const h = parseInt(time / 3600) const minute = parseInt(time / 60 % 60) const second = Math.ceil(time % 60) const hours 阅读全文
posted @ 2023-05-16 09:12 DL·Coder 阅读(19) 评论(0) 推荐(0)
摘要:传送门:https://blog.csdn.net/FTEzreal/article/details/115245562 传送门:https://juejin.cn/post/6844904016976035854 阅读全文
posted @ 2023-05-15 14:58 DL·Coder 阅读(16) 评论(0) 推荐(0)
摘要://判断系统类型 function OSnow() { const agent = navigator.userAgent.toLowerCase() const isMac = /macintosh|mac os x/i.test(navigator.userAgent) if (agent.in 阅读全文
posted @ 2023-05-12 09:50 DL·Coder 阅读(693) 评论(0) 推荐(0)
摘要:<el-table-column prop="cvRobotName" label="机器人" align="center" v-if="mode !== 2"> <template slot-scope="item"> <el-select v-model="tableData[scope.$in 阅读全文
posted @ 2023-05-08 10:21 DL·Coder 阅读(1026) 评论(0) 推荐(0)
摘要:判断是否有滚动条 // dom 元素 const dom = this.$refs.uploadTableRef?.bodyWrapper // 滚动到底部 if (dom?.scrollTop + dom?.clientHeight dom?.scrollHeight) { console.log 阅读全文
posted @ 2023-05-06 11:51 DL·Coder 阅读(625) 评论(0) 推荐(0)
摘要:效果图 搜索前: 搜索后: 使用 安装插件 pinyin-match: npm install pinyin-match --save 下拉: <el-select v-model="form.robot" placeholder="机器人" @change="robotSearch" filter 阅读全文
posted @ 2023-05-04 17:14 DL·Coder 阅读(1264) 评论(0) 推荐(0)
摘要:第一种,JS 1、判断dom this.$refs.squareRef.addEventListener('wheel', this.addScrolbarFn, false) addScrolbarFn(event) { event.stopPropagation() const dom = th 阅读全文
posted @ 2023-04-26 15:54 DL·Coder 阅读(230) 评论(0) 推荐(0)
摘要:一、js 判断 根据浏览器ua判断当前是否为移动设备: middleware中间件执行流程顺序: 1、nuxt.config.js 2、匹配布局 3、匹配页面 项目根目录下新建 middleware 文件夹,新建 midd.js 文件 export default function ({ isSer 阅读全文
posted @ 2023-03-20 10:25 DL·Coder 阅读(1358) 评论(0) 推荐(0)
摘要:// 替换 html 特殊字符 export function replaceHtmlSymbol(html) { if (html == null) { return '' } return html.replace(/</gm, '&lt;') .replace(/>/gm, '&gt;') . 阅读全文
posted @ 2023-02-07 15:33 DL·Coder 阅读(610) 评论(0) 推荐(0)
摘要:初始化 Map,在创建的同时初始化实例,可以给 Map 构造函数传入一个可迭代对象,需要包含键/值对数组。 // 使用嵌套数组初始化映射 const m1 = new Map([ ["key1", "val1"], ["key2", "val2"], ["key3", "val3"] ]); ale 阅读全文
posted @ 2023-02-07 09:22 DL·Coder 阅读(48) 评论(0) 推荐(0)
摘要:clientX 鼠标相对于浏览器(这里说的是浏览器的有效区域)左上角x轴的坐标; 不随滚动条滚动而改变; clientY 鼠标相对于浏览器(这里说的是浏览器的有效区域)左上角y轴的坐标; 不随滚动条滚动而改变; pageX 鼠标相对于浏览器(这里说的是浏览器的有效区域)左上角x轴的坐标; 随滚动条滚 阅读全文
posted @ 2022-12-29 13:53 DL·Coder 阅读(155) 评论(0) 推荐(0)
摘要:date-fns dayjs 传送门:https://mp.weixin.qq.com/s/EPoysX0ytb1WzKQHgnACTg 阅读全文
posted @ 2022-12-23 14:36 DL·Coder 阅读(24) 评论(0) 推荐(0)
摘要:样式 <el-upload class="upload-demo" action="/api/file/upload" :on-remove="handleRemove" multiple ref="uplpadFile" :limit="1" :on-exceed="handleExceed" : 阅读全文
posted @ 2022-12-09 08:54 DL·Coder 阅读(892) 评论(0) 推荐(0)
摘要:// 大小计算 calculateSize(size) { if (size > 1024) { return Math.floor((size / 1024) * 100) / 100 + 'MB' } else if (size <= 0) { return '0kb' } else { ret 阅读全文
posted @ 2022-11-25 13:11 DL·Coder 阅读(61) 评论(0) 推荐(0)