![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
杂七杂八
lt要努力
这个作者很懒,什么都没留下…
展开
-
数组根据对象属性去重
let arrs = [{user: 1}, {user: 1}, {user: 1}, {user: 2}]let hash = {}arrs.filter(arr => hash[arr.user] ? false : hash[arr.user] = true)原创 2020-10-22 14:04:29 · 239 阅读 · 0 评论 -
手动触发滚动事件
解决因为监听滚动事件手动计算滚动距离影响其他效果事件(textare滚动事件也算在这里面从而影响了页面效果,需手动让页面滚动1px,避免影响。)let evt = document.createEvent('UIEvents')evt.initUIEvent('scroll', true, false, window, 1)window.dispatchEvent(evt)这段代码可在页面数据请求完后调用,可在上段代码加个定时器,定时器时间为0...原创 2020-10-22 10:33:17 · 1531 阅读 · 0 评论 -
使用 i18n Ally不生效
把 i18n Ally 的版本号变低点就好了为什么要使用 i18n Ally可以在元素中显示对应的国际化语言,方便开发如下图原创 2020-10-14 17:15:33 · 2970 阅读 · 3 评论 -
发现一个好东西---线上的vue工具 Vue Devtools
强制开启Vue Devtoolshttps://greasyfork.org/zh-CN/scripts/396985-force-enable-vue-devtools如果遇上了这个问题,要安装油猴(Tampermonkey),或者是安装了没有开启原创 2020-10-09 16:47:28 · 621 阅读 · 0 评论 -
手机端媒体查询
@media (min-width: 320px) and (max-width: 359px){}@media (min-width: 360px) and (max-width: 374px){}@media (min-width: 375px) and (max-width: 385px){}@media (min-width: 386px) and (max-width: 392px) {}@media (min-width: 393px) and (max-widt原创 2020-09-22 15:55:25 · 807 阅读 · 0 评论 -
项目中的 .gitignore 文件
.gitignore 文件在项目的目录 与src同级。它是可以直接复制这个文件进项目中就能生效的。我项目中一般的.gitignore 规范.DS_Storenode_modules//dist/npm-debug.log*yarn-debug.log*yarn-error.log*/test/unit/coverage/# Editor directories and files.idea.vscode*.suo*.ntvs**.njsproj*.sln...原创 2020-05-20 16:19:40 · 195 阅读 · 0 评论