摘要: /** * 函数防抖 * @param {Function} func * @param {number} wait * @param {boolean} immediate * @return {*} */ export function debounce(func, wait, immediat 阅读全文
posted @ 2020-11-27 16:22 SaBoo 阅读(77) 评论(0) 推荐(0) 编辑
摘要: /** * 获取随机唯一字符串 * @returns {string} */ export function createUniqueString() { const timestamp = +new Date() + '' const randomNum = parseInt((1 + Math. 阅读全文
posted @ 2020-11-27 16:15 SaBoo 阅读(500) 评论(0) 推荐(0) 编辑
摘要: /** * 深拷贝 * @param {Object} source * @returns {Object} */ export function deepClone(source) { if (!source && typeof source !== 'object') { throw new E 阅读全文
posted @ 2020-11-27 16:07 SaBoo 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 先下载 uni-app 开发工具 hbuilderx 地址 https://www.dcloud.io/hbuilderx.html 如果是第一次使用,需要先配置小程序ide的相关路径,才能运行成功。 1. 首先找到 manifest.json 文件 然后找到 微信小程序配置 填写自己的 微信小程序 阅读全文
posted @ 2020-09-18 16:09 SaBoo 阅读(836) 评论(0) 推荐(0) 编辑
摘要: js 获取浏览器名称和版本 function getExplorerInfo() { let explorer = window.navigator.userAgent; explorer = explorer.toLowerCase(); //ie if (explorer.indexOf("ms 阅读全文
posted @ 2020-09-16 17:59 SaBoo 阅读(953) 评论(0) 推荐(0) 编辑
摘要: 在项目vue中遇到使用浏览器实现录音功能 要在https下才能实现! 要在https下才能实现!! 要在https下才能实现!!! 如果不是https,解决方案 https://www.cnblogs.com/Sabo-dudu/p/12449985.html 注意: 这里输入的文件格式为mp3,因 阅读全文
posted @ 2020-08-26 16:58 SaBoo 阅读(2489) 评论(0) 推荐(0) 编辑
摘要: 项目中经常用到的正则 只能为数字和字母 /^[\d\w]+$/ 只能是数字和字母的组合 6-20位 /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/; 6-8位,且只能包含数字和字母 /^[a-zA-Z0-9]{6,8}$/; 只能输入正数,并且最多支持2 阅读全文
posted @ 2020-08-20 18:16 SaBoo 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 在根目录下找到 .eslintrc 文件 然后修改成下面的代码,修改之后 必须重启 才能生效!!! module.exports = { root: true, env: { node: true }, 'extends': [ 'plugin:vue/essential', //'@vue/sta 阅读全文
posted @ 2020-06-12 10:24 SaBoo 阅读(448) 评论(0) 推荐(0) 编辑
摘要: 执行命令 npm run build -- --report 生成 dist 文件夹 下面的 report.html 文件 阅读全文
posted @ 2020-05-12 10:00 SaBoo 阅读(514) 评论(0) 推荐(0) 编辑
摘要: axios 全局统一拦截 参看 https://zacharykwan.com/2018/05/22/%E9%85%8D%E5%90%88%20axios%20%E5%AE%9E%E7%8E%B0%E9%98%B2%E9%87%8D%E6%8F%90%E4%BA%A4/ let pending = 阅读全文
posted @ 2020-03-10 17:38 SaBoo 阅读(2779) 评论(0) 推荐(0) 编辑