摘要: function getRandomNumber(min,max){ min = Math.ceil(min); //向上取整 max = Math.floor(max); //向下取整 Math.round(num) 四舍五入 return Math.floor(Math.random()*(ma 阅读全文
posted @ 2022-04-08 17:35 萌小心情懂 阅读(36) 评论(0) 推荐(0) 编辑
摘要: 打开设置,搜索fileheader 在配置文件中添加: "fileheader.customMade": { //此为头部注释 "Description": "", "Version": "2.0", "Autor": "lhl", "Date": "Do not edit", "LastEdito 阅读全文
posted @ 2022-03-26 15:47 萌小心情懂 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 如果项目有轮播翻页等效果,可以通过swiper实现 npm i swiper -S 在低版本浏览器下使用,会出现es6语法的无法解析。需要将es6转为es5,一般情况下只需要在transpileDependencies中增加依赖包名的配置即可。Swiper.js 这个 npm 包里面还使用了 dom 阅读全文
posted @ 2021-02-20 11:59 萌小心情懂 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 前端需要传页面的url给后端,其中不包含#之后的内容,后端会返回timestamp、nonceStr、signature that.$http.post(that.$api.getH5Sign, { url: window.location.href.split('#')[0] }).then(re 阅读全文
posted @ 2021-01-19 15:45 萌小心情懂 阅读(4410) 评论(0) 推荐(0) 编辑
摘要: <form method="post" enctype="multipart/form-data" style="display:none"> <input :id="id" name="file" type="file" @change="selectFile" accept="image/*" 阅读全文
posted @ 2020-10-23 16:21 萌小心情懂 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 在vue.config.js modules export添加devserve devServer: { proxy: { '/baiduaa': { target: 'https://baidu.com', // 接口的域名 secure: false, // 如果是https接口,需要配置这个参 阅读全文
posted @ 2019-07-22 11:50 萌小心情懂 阅读(240) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2019-07-20 18:27 萌小心情懂 阅读(6) 评论(0) 推荐(0) 编辑
摘要: webpack打包 生产模式:webpack main.js -o index.js 开发模式:webpack --mode development main.js -o index.js 或者webpack --mode development(如果main.js在src文件夹下,那么打包出来的文 阅读全文
posted @ 2019-07-20 17:28 萌小心情懂 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 函数防抖是指对于在事件被触发n秒后再执行的回调,如果在这n秒内又重新被触发,则重新开始计时,是常见的优化,适用于 表单组件输入内容验证 防止多次点击导致表单多次提交 等情况,防止函数过于频繁的不必要的调用。 思路 用 setTimeout 实现计时,配合 clearTimeout 实现“重新开始计时 阅读全文
posted @ 2019-07-10 09:23 萌小心情懂 阅读(664) 评论(0) 推荐(0) 编辑
摘要: Date.prototype.Format = function Format(fmt){ var o = { "M+": this.getMonth()+1, "d+": this.getDate(), "H+": this.getHours(), "m+": this.getMinutes(), ... 阅读全文
posted @ 2018-09-06 16:52 萌小心情懂 阅读(175) 评论(0) 推荐(0) 编辑