
js
开普勒581b
这个作者很懒,什么都没留下…
展开
-
vue初始化data
vue初始化data原创 2023-02-04 11:14:26 · 884 阅读 · 0 评论 -
小程序时间适配ios问题
ios 不适配 YYY-MM-DD如果需求是只显示月日,必须要在前面加一个假的年,如果没有年则ios不识别报错 Invalid Date例子// 更改月的格式为中国格式monthChina(time) { // day 为dayjs框架用于操作时间 // 通过这种方式在前方加入假的年份让ios识别 return day(`1998-${time}`).format('MM月DD日'); },...原创 2022-03-19 19:26:48 · 563 阅读 · 0 评论 -
node 密码加密
const crypto = require('crypto'); // 引入crypto模块 const {Buffer} = require('buffer'); // buffer类型转换const algorithm = 'aes-128-cbc'; // 生成密码的加密格式const UTF_8 = 'utf-8'; // 编码格式const encoding = 'base64'; // 输出加密格式const iterations = 10000; // 密匙迭代次数,次数越高越.原创 2022-02-19 18:33:53 · 1046 阅读 · 1 评论 -
高阶函数笔记
【代码】高阶函数笔记。原创 2021-10-21 23:38:02 · 180 阅读 · 0 评论 -
Vue 设置路由title
router下设置title如下routes: [ { path: '/login', name: 'login', component: Login, meta: { title: '我是登录' } },]这个时候注意设定完该title目前没有作用,因为他目前只是存在于路由记录中这个时候我们需要在main.js中设置前置导航守卫允许添加titlerouter.beforeEach(to => { document.title原创 2021-10-13 23:24:42 · 2243 阅读 · 0 评论 -
ES6 箭头函数注意事项
注意这个是译音符不是单引号,单引号只会返回字符串不会显示参数;原创 2021-08-18 20:43:03 · 95 阅读 · 0 评论 -
css超出部分用规定字符替代
content{ /* 给个固定的宽 */ width:415rpx; /* 超出隐藏 */ overflow: hidden; /* 超出部分默认为...替代 */ text-overflow: ellipsis; /* 规定替代符号 */ content: '...'; /* 文字不换行并且为最高权重 */ white-spa...原创 2018-10-23 13:47:51 · 534 阅读 · 0 评论 -
css textarea给padding导致溢出
比如这样: 因为textarea不包含内边距与边线所以即使给固定的宽高也会溢出,所以加上:那就通过加上box-sizing:border-box让它拥有内边距与边线。原创 2018-10-23 13:02:50 · 4286 阅读 · 1 评论 -
rem做到pc端到移动端自适应
将下面自适应js代码放到head下面body上面adaptive(document, window);//初始加载自适应function adaptive(doc, win) { var docEl = doc.documentElement, resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resi...原创 2018-09-19 14:25:08 · 4072 阅读 · 1 评论 -
rem与px换算
html标签的font-size=69px(根据rem自适应算法得到的)UI给的字体大小为14px我想得到这14px等于多少rem14px÷69px得到0.2rem所以rem与px换算是根据html标签的font-size进行比率换算的...原创 2018-09-19 12:12:44 · 3755 阅读 · 0 评论 -
h5页面传参截取参数如果是中文导致GB2312编码问题
//这是一个普通的页面传参其中address_name传递的参数有可能是中文 $(document).on('click','#rom-url',function(){ window.location.href = './index2.html?room_id='+room_id+'&address_name='+resone; ...原创 2018-06-26 10:31:08 · 668 阅读 · 0 评论 -
如何让前端浏览器不进行缓存
<!DOCTYPE html><html> <head> <meta charset="utf-8" /> <!--设置过期时间设置0为直接过期并清除缓存--> <meta http-equiv="Expires" content="0"> <!-原创 2018-06-27 12:25:51 · 6432 阅读 · 0 评论