摘要:
Nginx vue项目配置好后,刷新页面会出现404? 方案:增加重定向 try_files $uri $uri/ /index.html; mac配置Nginx 1、brew install nginx 安装nginx 2、brew info nginx 查询nginx信息 3、查看/修改ngin 阅读全文
摘要:
function getRandomNumber(min,max){ min = Math.ceil(min); //向上取整 max = Math.floor(max); //向下取整 Math.round(num) 四舍五入 return Math.floor(Math.random()*(ma 阅读全文
摘要:
打开设置,搜索fileheader 在配置文件中添加: "fileheader.customMade": { //此为头部注释 "Description": "", "Version": "2.0", "Autor": "lhl", "Date": "Do not edit", "LastEdito 阅读全文
摘要:
如果项目有轮播翻页等效果,可以通过swiper实现 npm i swiper -S 在低版本浏览器下使用,会出现es6语法的无法解析。需要将es6转为es5,一般情况下只需要在transpileDependencies中增加依赖包名的配置即可。Swiper.js 这个 npm 包里面还使用了 dom 阅读全文
摘要:
前端需要传页面的url给后端,其中不包含#之后的内容,后端会返回timestamp、nonceStr、signature that.$http.post(that.$api.getH5Sign, { url: window.location.href.split('#')[0] }).then(re 阅读全文
摘要:
<form method="post" enctype="multipart/form-data" style="display:none"> <input :id="id" name="file" type="file" @change="selectFile" accept="image/*" 阅读全文
摘要:
在vue.config.js modules export添加devserve devServer: { proxy: { '/baiduaa': { target: 'https://baidu.com', // 接口的域名 secure: false, // 如果是https接口,需要配置这个参 阅读全文
只有注册用户登录后才能阅读该文。 阅读全文
摘要:
webpack打包 生产模式:webpack main.js -o index.js 开发模式:webpack --mode development main.js -o index.js 或者webpack --mode development(如果main.js在src文件夹下,那么打包出来的文 阅读全文
摘要:
函数防抖是指对于在事件被触发n秒后再执行的回调,如果在这n秒内又重新被触发,则重新开始计时,是常见的优化,适用于 表单组件输入内容验证 防止多次点击导致表单多次提交 等情况,防止函数过于频繁的不必要的调用。 思路 用 setTimeout 实现计时,配合 clearTimeout 实现“重新开始计时 阅读全文