会员
周边
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
PromiseOne
博客园
首页
新随笔
联系
管理
订阅
上一页
1
···
3
4
5
6
7
8
下一页
2020年6月3日
vue数据更新了,页面不变。
摘要: 1. Vue 无法检测实例被创建时不存在于 data 中的 property 原因:由于 Vue 会在初始化实例时对 property 执行 getter/setter 转化,所以 property 必须在 data 对象上存在才能让 Vue 将它转换为响应式的。 场景: var vm = new
阅读全文
posted @ 2020-06-03 17:09 PromiseOne
阅读(2012)
评论(0)
推荐(1)
2020年6月2日
forEach 终止循环
摘要: 1 let arr= ['baidu', 'google', 'taobao']; 2 try{ 3 arr.forEach(item=>{ 4 if(item == 'google'){ 5 throw new Error(); 6 } 7 }) 8 }catch(e){ 9 return; 10
阅读全文
posted @ 2020-06-02 19:05 PromiseOne
阅读(1644)
评论(0)
推荐(0)
js 解决引用赋值导致修改新数组(对象)导致原数组(对象)跟着改变的问题
摘要: 原因:JavaScript 中对象的赋值是默认引用赋值的(两个对象指向相同的内存地址) 解决方案1: 用 JSON.stringify 把对象转换成字符串,再用 JSON.parse 把字符串转换成新的对象 function deepClone(obj){ return JSON.parse(JSO
阅读全文
posted @ 2020-06-02 15:44 PromiseOne
阅读(2667)
评论(0)
推荐(0)
2020年2月19日
es6判断数组是否包含某个元素
摘要: 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
阅读(30998)
评论(0)
推荐(0)
2020年1月13日
tab css 切换效果
摘要: <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
阅读(191)
评论(0)
推荐(0)
2019年8月12日
小程序返回上个页面 修改上个页面的数据
摘要: var pages = getCurrentPages(); //当前页面 var prevPage = pages[pages.length - 2]; //上一页面 prevPage.setData({ //上个页面数据赋值 });
阅读全文
posted @ 2019-08-12 09:59 PromiseOne
阅读(874)
评论(0)
推荐(0)
2019年7月3日
小程序 scroll-view scroll-x 不生效
摘要: 1 .order-tabs{ 2 white-space:nowrap; 3 }
阅读全文
posted @ 2019-07-03 16:53 PromiseOne
阅读(629)
评论(0)
推荐(0)
2019年6月14日
proxy跨域处理
摘要: 拿vue-cli举例,在项目目录中找到根目录下config文件夹下的index.js文件。配置在dev里面: dev: { // Paths assetsSubDirectory: 'static', assetsPublicPath: '/', proxyTable: { '/api': { ta
阅读全文
posted @ 2019-06-14 14:38 PromiseOne
阅读(1332)
评论(0)
推荐(0)
2019年5月13日
修改小程序radio组件的默认样式
摘要: /* 默认背景样式*/ radio .wx-radio-input{ width: 40rpx; height: 40rpx; } /* 选中后的 背景样式 (红色背景 无边框 可根据UI需求自己修改) */ radio .wx-radio-input.wx-radio-input-checked{
阅读全文
posted @ 2019-05-13 14:37 PromiseOne
阅读(242)
评论(0)
推荐(0)
2019年4月1日
优化JS 条件语句的5个技巧
摘要: 在使用 JavaScript 时,我们会处理很多条件语句,这里有 5 个技巧可以帮助您编写更好、更简洁的条件语句。 1、对多个条件使用 Array.includes 让我们看看下面的例子: // condition function test(fruit) { if (fruit == 'apple
阅读全文
posted @ 2019-04-01 16:07 PromiseOne
阅读(587)
评论(0)
推荐(0)
上一页
1
···
3
4
5
6
7
8
下一页
公告