上一页 1 ··· 8 9 10 11 12 13 下一页
摘要: js中的数组遍历是项目中经常用到的,在这里将几种方法做个对比。 ! for循环:使用评率最高,也是最基本的一种遍历方式。 let arr = ['a','b','c','d','e']; for (let i = 0, len = arr.length; i < len; i++) { consol 阅读全文
posted @ 2019-01-31 10:51 Webwhl 阅读(258) 评论(0) 推荐(0)
摘要: //ES5合并数组 var arr = [12,true,5]; var arrCont = [1,6,66].concat(arr); console.log(arrCont);//[1, 6, 66, 12, true, 5] //ES6 var arr = [12,true,5]; var a 阅读全文
posted @ 2019-01-31 10:42 Webwhl 阅读(789) 评论(0) 推荐(0)
摘要: function f(){ var a = Array.prototype.slice.call(arguments);//传的参数转为数组 var sum= 0; a.forEach(function(item){ sum+=item*1; }) return sum } console.log( 阅读全文
posted @ 2019-01-31 10:35 Webwhl 阅读(2034) 评论(0) 推荐(0)
摘要: 每个页面都要在app.json中配置 "pages": [ "pages/index/index", "pages/list/list", "pages/RealTimeData/RealTimeData", "pages/buildInfo/buildInfo", "pages/search/se 阅读全文
posted @ 2019-01-22 15:07 Webwhl 阅读(172) 评论(0) 推荐(0)
摘要: <component v-if="hackReset"></component> 2 3 4 this.hackReset = false this.$nextTick(() => { this.hackReset = true }) hackReset写在父data中开始hackReset=tru 阅读全文
posted @ 2019-01-03 09:50 Webwhl 阅读(663) 评论(0) 推荐(0)
摘要: 1、首先,底部的高不能写死。 2、 var footer = $api.byId('footer'); $api.fixTabBar(footer);这句应该写在 footerHeight = $api.offset(footer).h;前面 阅读全文
posted @ 2018-12-17 17:27 Webwhl 阅读(729) 评论(0) 推荐(0)
摘要: //slots:[{values: ['年假', '事假', '病假', '婚假', '其他']}], slots:[{values: []}], onValuesChange(picker,values) {// console.log(picker)// console.log(values) 阅读全文
posted @ 2018-12-17 11:18 Webwhl 阅读(217) 评论(0) 推荐(0)
摘要: 页面布局时头部和内容一定要分开,状态栏寖入式要用。可以用api.sendEvent广播出去,api.addlisterten监听. api.openWin打开页面会有黑色闪屏,加bgColor:'#fff', ios有页面滑动加 slidBackEnabled: false去掉. 启动页 打开到登录 阅读全文
posted @ 2018-12-13 17:21 Webwhl 阅读(991) 评论(0) 推荐(0)
摘要: <p id="timeTxt"></p> <script type="text/javascript"> function add(m){ return m<10 ? "0"+m : m; } var time2 = new Date().getTime(); function getTime(ti 阅读全文
posted @ 2018-12-13 11:29 Webwhl 阅读(164) 评论(0) 推荐(0)
摘要: function datezh(s){ return s = s>9 ? s:"0"+s } function dateTime(t){ var getNowTime = vm.getServerTime.replace(/-/g,"/");//vue vm.getServerTime获取到的服务器 阅读全文
posted @ 2018-12-12 14:31 Webwhl 阅读(183) 评论(0) 推荐(0)
上一页 1 ··· 8 9 10 11 12 13 下一页