Loading

上一页 1 2 3 4 5 6 7 ··· 10 下一页
摘要: 函数防抖 频繁触发,只在特定的时间内执行一次代码。 应用场景:onrize,onscroll等频繁触发的函数,比如你想获取滚动条的位置,然后执行下一步动作 //函数防抖 function debounce(fn,delay){ let timer = null; return function () 阅读全文
posted @ 2021-03-15 15:47 冯叶青 阅读(119) 评论(0) 推荐(0) 编辑
摘要: node 常用方法 生成密钥 token验证 验证码生成 生成密钥 //生成密钥 generateToken(data, expires = 7200) { const exp = Math.floor(Date.now() / 1000) + expires const cert = fs.rea 阅读全文
posted @ 2021-01-22 16:35 冯叶青 阅读(954) 评论(0) 推荐(0) 编辑
摘要: middleware/jwt.js module.exports = (options, app) => { return async function userInterceptor(ctx, next) { //获取token 获取前端或以其他方式设置的cookie需要设置signed: fal 阅读全文
posted @ 2021-01-22 16:28 冯叶青 阅读(393) 评论(0) 推荐(1) 编辑
摘要: js给页面容器增加水印 /* * 功能:给页面容器增加水印 * * 用法 watermark({ watermark_ele:'#industry-contacts', watermark_txt:`AI固收 ${this.sysUserInfo.phone}`, watermark_width: 阅读全文
posted @ 2021-01-22 15:47 冯叶青 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 功能:基础功能群聊 文件上传 图片上传 表情发送 超链接跳转 注:里面涉及到诸多函数依赖,请忽略,只看主要功能即可 html <template> <div class="container" :style="{'top':'calc('+marginTop+' + 0.16rem)'}"> <di 阅读全文
posted @ 2021-01-21 15:57 冯叶青 阅读(650) 评论(0) 推荐(0) 编辑
摘要: 前端工具箱 复制粘贴 获取随机数 滑动防触发点击事件 获取地址栏参数 函数防抖 js动态加载 css动态加载 h5与app交互封装 js时间格式化 阅读全文
posted @ 2021-01-21 15:04 冯叶青 阅读(363) 评论(0) 推荐(0) 编辑
摘要: 移动端兼容性问题 ios滑动不是很流畅问题 安卓和IOS长安页面会复制文字等 CSS问题 解决ios滑动不是很流畅 -webkit-overflow-scrolling: touch;//滑动容器上加上该css 解决ios input框默认有一层灰色渐变 -webkit-appearance:non 阅读全文
posted @ 2020-10-16 14:22 冯叶青 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 以用户模块为例 soter 结构 //soter 结构 ─store │ getters.js │ index.js │ └─modules user.js modules /store/modules/user.js /** * 用户信息 * */ const user = { state: { 阅读全文
posted @ 2020-08-26 17:37 冯叶青 阅读(1742) 评论(0) 推荐(0) 编辑
摘要: 应用场景:微信网页 在写微信网页的时候每次打开页面都会跳转到微信授权页面,然后微信授权时拿的是你的本地地址去授权,此时肯定是授权不了的(拿不到code),所以此时就可以写一个判断,如果是本地调试的不做授权跳转,如果是线上环境就跳转授权页 //webpack.dev.conf.js const ENV 阅读全文
posted @ 2020-08-26 17:09 冯叶青 阅读(601) 评论(0) 推荐(0) 编辑
摘要: webpack手动搭建vue运行环境 先看最终配置完的文件目录 │ .babelrc │ index.html │ package.json ├─build │ webpack.base.js │ webpack.dev.js └─src │ App.vue │ index.js ├─router 阅读全文
posted @ 2020-08-13 11:12 冯叶青 阅读(401) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 10 下一页