摘要: 一.建立print.js,代码封装如下: export default function printHtml(html) { const style = getStyle() const container = getContainer(html) document.body.appendChild 阅读全文
posted @ 2022-03-22 14:39 雨季的泪 阅读(1825) 评论(0) 推荐(0) 编辑
摘要: function copyText(text){ var input = document.createElement('input'); input.setAttribute('id', 'input_for_copyText'); input.value = text; document.get 阅读全文
posted @ 2022-03-15 13:50 雨季的泪 阅读(997) 评论(0) 推荐(0) 编辑
摘要: 经常遇到需要配置多入口文件的需求,做下总结记录: 第一步:在public文件下创建一个app.html页面的文件。 在项目public文件夹下创建一个app.html,其实就是将index.html复制一份,将title和name改一下: ps:如果不需要特殊引入其他js,也可以配置好,会自动生成a 阅读全文
posted @ 2022-03-08 16:28 雨季的泪 阅读(1656) 评论(0) 推荐(0) 编辑
摘要: 一、display:inline-block; 在想标签处于一行,设置值为inline-block,经常会有标签之间对齐方式不一致的问题,此时新增另外一个属性vertical-align: top;即可,经常使用的是top或者middle。 display: inline-block; /* bas 阅读全文
posted @ 2022-03-01 16:23 雨季的泪 阅读(64) 评论(0) 推荐(0) 编辑
摘要: 改造element的Dialog组件,鼠标在头部按下可拖拽弹窗位置,鼠标抬起解绑事件。不考虑通用,其他场景自行改造class类名即可。 一、新建directives.js文件 //创建directives.js文件 import Vue from 'vue'; // v-dialogDrag: 弹窗 阅读全文
posted @ 2022-03-01 16:03 雨季的泪 阅读(506) 评论(0) 推荐(0) 编辑
摘要: 格式化时间代码,未考虑格式和通用设计,只是最原始的样子 formatTime(time) { if (('' + time).length 10) { time = parseInt(time) * 1000 } else { time = +time } const d = new Date(ti 阅读全文
posted @ 2022-03-01 15:51 雨季的泪 阅读(97) 评论(0) 推荐(0) 编辑
摘要: js获取本周,本月,本季度,本年起止时间,直接上代码 timeSlotChange(val){ let startTime, endTime; let now = new Date(); //当前日期 var nowDayOfWeek = now.getDay(); //今天本周的第几天 var n 阅读全文
posted @ 2021-11-10 17:03 雨季的泪 阅读(869) 评论(0) 推荐(0) 编辑