上一页 1 ··· 3 4 5 6 7 8 下一页
摘要: 原因:JavaScript 中对象的赋值是默认引用赋值的(两个对象指向相同的内存地址) 解决方案1: 用 JSON.stringify 把对象转换成字符串,再用 JSON.parse 把字符串转换成新的对象 function deepClone(obj){ return JSON.parse(JSO 阅读全文
posted @ 2020-06-02 15:44 PromiseOne 阅读(2481) 评论(0) 推荐(0) 编辑
摘要: 1 let arr= ['baidu', 'google', 'taobao']; 2 3 console.log(arr.includes('baidu')); //true 4 console.log(arr.includes('baidu1')); //false 阅读全文
posted @ 2020-02-19 10:42 PromiseOne 阅读(30939) 评论(0) 推荐(0) 编辑
摘要: <div class="tabs-list"> <div class="tabs-content"> <div v-for="(item,index) in test" :key="index" @click="txt(index)" :class="current index?'active':' 阅读全文
posted @ 2020-01-13 17:11 PromiseOne 阅读(171) 评论(0) 推荐(0) 编辑
摘要: var pages = getCurrentPages(); //当前页面 var prevPage = pages[pages.length - 2]; //上一页面 prevPage.setData({ //上个页面数据赋值 }); 阅读全文
posted @ 2019-08-12 09:59 PromiseOne 阅读(853) 评论(0) 推荐(0) 编辑
摘要: 1 .order-tabs{ 2 white-space:nowrap; 3 } 阅读全文
posted @ 2019-07-03 16:53 PromiseOne 阅读(605) 评论(0) 推荐(0) 编辑
摘要: 拿vue-cli举例,在项目目录中找到根目录下config文件夹下的index.js文件。配置在dev里面: dev: { // Paths assetsSubDirectory: 'static', assetsPublicPath: '/', proxyTable: { '/api': { ta 阅读全文
posted @ 2019-06-14 14:38 PromiseOne 阅读(1305) 评论(0) 推荐(0) 编辑
摘要: /* 默认背景样式*/ radio .wx-radio-input{ width: 40rpx; height: 40rpx; } /* 选中后的 背景样式 (红色背景 无边框 可根据UI需求自己修改) */ radio .wx-radio-input.wx-radio-input-checked{ 阅读全文
posted @ 2019-05-13 14:37 PromiseOne 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 在使用 JavaScript 时,我们会处理很多条件语句,这里有 5 个技巧可以帮助您编写更好、更简洁的条件语句。 1、对多个条件使用 Array.includes 让我们看看下面的例子: // condition function test(fruit) { if (fruit == 'apple 阅读全文
posted @ 2019-04-01 16:07 PromiseOne 阅读(540) 评论(0) 推荐(0) 编辑
摘要: 用on的代码: window.onload = function(){ var box = document.getElementById("box"); box.onclick = function(){ console.log("我是box1"); } box.onclick = functio 阅读全文
posted @ 2019-03-28 15:23 PromiseOne 阅读(1178) 评论(0) 推荐(0) 编辑
摘要: finger-mover(http://fmover.hcysun.me/#/zh-cn/) better-scroll(http://ustbhuangyi.github.io/better-scroll/doc/options.html) 阅读全文
posted @ 2019-03-04 16:11 PromiseOne 阅读(183) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 下一页