摘要: Math.random() 返回一个0~1之间的随机数; Math.floor() 向下取整; Math.ceil() 向上取整; Math.round() 四舍五入; Math.fround() 32位浮点数; 1~10随机数 let num = Math.floor(Math.random() 阅读全文
posted @ 2022-08-30 14:45 DL·Coder 阅读(1680) 评论(0) 推荐(0) 编辑
摘要: 传送门:https://blog.csdn.net/weixin_43575792/article/details/123224908 阅读全文
posted @ 2022-08-30 14:30 DL·Coder 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 传送门:82种阴影效果demo 传送门:https://juejin.cn/post/7034323356459466760 阅读全文
posted @ 2022-08-30 11:56 DL·Coder 阅读(19) 评论(0) 推荐(0) 编辑
摘要: <div @mousedown.self="handleMouseDown($event)"> /* 鼠标按下方法 */ handleMouseDown(event) { if(event.ctrlKey && event.which 1) { // ctrl + 鼠标左键组合键触发 } else 阅读全文
posted @ 2022-08-30 11:27 DL·Coder 阅读(464) 评论(0) 推荐(0) 编辑
摘要: 传送门:https://juejin.cn/post/7136864563172999176 阅读全文
posted @ 2022-08-30 09:49 DL·Coder 阅读(72) 评论(0) 推荐(0) 编辑
摘要: 使用 element 上传组件,FileReader 解析 JSON 文件。 template 代码 <el-dialog title="提示" :visible.sync="dialogVisible" width="25%"> <el-row class="dialogBox"> <el-upl 阅读全文
posted @ 2022-08-30 09:44 DL·Coder 阅读(1258) 评论(0) 推荐(0) 编辑
摘要: 多个if判断,看着很乱,使用优雅的代码实现 一个判断 if (fruit == 'apple' ) { console.log('red'); } 俩个判断 if (fruit == 'apple' || fruit == 'strawberry') { console.log('red'); } 阅读全文
posted @ 2022-08-30 08:47 DL·Coder 阅读(1345) 评论(0) 推荐(0) 编辑