随笔分类 -  JS

摘要:解决文章:点我 阅读全文
posted @ 2024-10-21 17:19 DL·Coder 阅读(17) 评论(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 阅读(441) 评论(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 阅读(2241) 评论(0) 推荐(0) 编辑
摘要:getQueryParams() { const paramsString = new URLSearchParams(window.location.search).toString(); // 将查询字符串转换为字符串 const paramsArray = paramsString.split 阅读全文
posted @ 2023-05-16 11:56 DL·Coder 阅读(122) 评论(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 阅读(14) 评论(0) 推荐(0) 编辑
摘要:传送门:https://blog.csdn.net/FTEzreal/article/details/115245562 传送门:https://juejin.cn/post/6844904016976035854 阅读全文
posted @ 2023-05-15 14:58 DL·Coder 阅读(10) 评论(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 阅读(633) 评论(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 阅读(927) 评论(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 阅读(563) 评论(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 阅读(1074) 评论(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 阅读(194) 评论(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 阅读(1256) 评论(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 阅读(557) 评论(0) 推荐(0) 编辑
摘要:初始化 Map,在创建的同时初始化实例,可以给 Map 构造函数传入一个可迭代对象,需要包含键/值对数组。 // 使用嵌套数组初始化映射 const m1 = new Map([ ["key1", "val1"], ["key2", "val2"], ["key3", "val3"] ]); ale 阅读全文
posted @ 2023-02-07 09:22 DL·Coder 阅读(40) 评论(0) 推荐(0) 编辑
摘要:clientX 鼠标相对于浏览器(这里说的是浏览器的有效区域)左上角x轴的坐标; 不随滚动条滚动而改变; clientY 鼠标相对于浏览器(这里说的是浏览器的有效区域)左上角y轴的坐标; 不随滚动条滚动而改变; pageX 鼠标相对于浏览器(这里说的是浏览器的有效区域)左上角x轴的坐标; 随滚动条滚 阅读全文
posted @ 2022-12-29 13:53 DL·Coder 阅读(137) 评论(0) 推荐(0) 编辑
摘要:date-fns dayjs 传送门:https://mp.weixin.qq.com/s/EPoysX0ytb1WzKQHgnACTg 阅读全文
posted @ 2022-12-23 14:36 DL·Coder 阅读(22) 评论(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 阅读(850) 评论(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 阅读(59) 评论(0) 推荐(0) 编辑
摘要:获取后台数据接口,当数据无的时候,可以移除滚动监听 mounted() { // 监听滚动 window.addEventListener("scroll", this.getScroll, true); }, // 瀑布流滚动到底部 getScroll() { // vue 获取元素 const 阅读全文
posted @ 2022-10-12 11:22 DL·Coder 阅读(1442) 评论(0) 推荐(0) 编辑
摘要:Object.defineProperty 实现 相当于全局劫持 a ,只要发现 a ,就执行方法(三目运算符); Object.defineProperty(window, 'a', { get: function () { //this指向window.a this.value ? this.v 阅读全文
posted @ 2022-09-01 14:11 DL·Coder 阅读(63) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示