JS+Vue
2018-10-24 本文已影响1人
zlf_j
-
使用
返回上一页:
<button onclick="goBack()">返回上一页</button>
<script>
function goBack(){
window.history.go(-1) -2即为退后2页
}
</script>
点击回到顶部
document.body.scrollTop = 0
document.documentElement.scrollTop = 0
es6中 数组去重
this.newarr = Array.from(new Set(this.arr))
Object.keys(obj) ----- 将对象排序输出
- obj 要返回其枚举自身属性的对象。--- 要排序的对象
eg:
var anObj = { 100: 'a', 2: 'b', 7: 'c' };
console.log(Object.keys(anObj)); // console: ['2', '7', '100']
数组删除指定下标 (splice)
//删除起始下标为1,长度为2的一个值(len设置2)
var arr2 = ['a','b','c','d']
arr2.splice(1,2);
console.log(arr2);
//['a','d']
js数组根据多个属性进行排序
https://blog.csdn.net/wyg1995/article/details/79432489
js根据json数据中的某一个属性来给数据分组
https://blog.csdn.net/firoly/article/details/54314367
js判断对象是否为空对象的几种方法
v-if=" JSON.stringify(obj) == '{}' " // 即obj为空对象时
https://blog.csdn.net/qq_38627581/article/details/77353015
将v-for生成的input框数据用v-model绑定到一个数组
a{
cur:[],
}, //把这个数组cur外面包个对象
v-model="a.cur[index]"
https://blog.csdn.net/TateBrwonJava/article/details/80616074
-
了解
localStorage、sessionStorage
https://www.cnblogs.com/st-leslie/p/5617130.html
运输层(UDP和TCP三次握手,四次挥手分析)
https://www.cnblogs.com/whgk/p/6118206.html
WebSocket 详解教程
https://www.cnblogs.com/jingmoxukong/p/7755643.html
js跨域请求数据的3种常用的方法
https://blog.csdn.net/huozhiwu_11/article/details/78742979
使用Flexible实现手淘H5页面的终端适配
https://www.w3cplus.com/mobile/lib-flexible-for-html5-layout.html
-
正则
这20个正则表达式,让你少写1,000行代码
https://blog.csdn.net/jungle_hello/article/details/51648056
JS正则表达式验证是否为11位有效手机号码
https://blog.csdn.net/nongweiyilady/article/details/74007124
正则表达式(二)验证邮箱、电话号码
https://blog.csdn.net/diligentkong/article/details/71728718
正则表达式-邮箱有效性验证
https://blog.csdn.net/liudglink/article/details/78511759