js
yzmy
这个作者很懒,什么都没留下…
展开
-
layui 父页面弹出子页面做完操作后 关闭父页面的弹出框
layui.use('form', function () { var form = layui.form; var layer = parent.layer === undefined ? layui.layer : top.layer; }); //第一种方式 (我用的是layui+vue)下面的parent.patientSurvey中的patientSurvey是new Vue 时里面的那个Id; 父页面parent.patientSurvey.querySurv.原创 2021-12-28 17:12:10 · 1147 阅读 · 0 评论 -
js全局匹配img标签使其自适应
我这个有个局限性 就是已经在页面写好的img标签是不能匹配上的 是要动态的img标签// 正则匹配所有img标签// 正则匹配不含style="" 或 style='' 的img标签var regex1 = new RegExp("(i?)(\<img)(?!(.*?style=['\"](.*)['\"])[^\>]+\>)", 'gmi')// 给不含style="" 或 style='' 的img标签加上style=""that.content = that.content原创 2021-12-06 10:40:40 · 436 阅读 · 0 评论 -
table2excel不导出指定列
方法一步骤一: //根据name属性(应该也可以用id) 获取某一个dom 并且为其添加class $('td[name = "xxx"]').addClass("noExl");步骤二: that.$("#xxx").table2excel({ exclude: ".noExl",// 添加样式 name: title, printCss: css.join(' ')原创 2021-11-16 11:19:20 · 481 阅读 · 0 评论 -
js获取当前时间以及获取过去、未来多少天日期
获取当前时间var now = new Date();var beginDate = now.getFullYear() + "-" + (now.getMonth() + 1) + "-" + now.getDate();//(now.getMonth() + 1) 因为now.getMonth()获取的月份是0-11 0是一月、11是十二月所以需要+1过去、未来隔多少天获取日期 var date1 = new Date();//当前时间 var date2 = new Date(dat原创 2021-08-10 17:12:20 · 1414 阅读 · 0 评论