会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
xin-kw
博客园
首页
新随笔
联系
订阅
管理
2023年10月25日
react18版本跨域配置
摘要: 1. 安装 http-proxy-middleware npm install http-proxy-middleware#顺便安装一下 axios ,不用也可以,用fetch也一样。npm install axios 2. src目录下创建一个 setupProxy.js文件 里面的'api'代表
阅读全文
posted @ 2023-10-25 16:01 爱吃变态辣
阅读(278)
评论(0)
推荐(0)
2023年6月30日
uniapp分页请求
摘要: <template> <view> 循环请求的数据 </view> <view> {{ isLoading ? 加载中...' : '没有更多了' }} </view> </template> export default { data(){ return{ dataForm:[ ],//分页数据
阅读全文
posted @ 2023-06-30 10:03 爱吃变态辣
阅读(85)
评论(0)
推荐(0)
2023年6月9日
将每个对象中的键值对添加到一个新数组中渲染出来
摘要: data(){ userData:[ { content:{哈哈:123} }, { content:{喝喝:456} }, ], } for (let i = 0; i < this.userData.length; i++) { this.userData[ i ].content1 = [ ]
阅读全文
posted @ 2023-06-09 19:43 爱吃变态辣
阅读(47)
评论(0)
推荐(0)
2023年6月8日
点击元素上下移动
摘要: <template> <view class=""> <ul id="myList"> <li v-for="(item, index) in items" :key="item.id"> <span>{{ item.val }}</span> <button @click="changeOrder
阅读全文
posted @ 2023-06-08 14:44 爱吃变态辣
阅读(42)
评论(0)
推荐(0)
2023年6月1日
当数字大于5位时显示万的处理
摘要: if(a.length>4){a = (Math.floor((a / 10000) * 10) / 10) + '万' //保留一位小数,保留两位小数的话就乘以100再除以100 if(a.indexOf('.') 1){a = a.replace('万','.0万')//如果为整数时就补0 }
阅读全文
posted @ 2023-06-01 15:09 爱吃变态辣
阅读(106)
评论(0)
推荐(0)
2023年5月25日
多选自定义事件
摘要: <template> <view @click="onSelect(item,index)" v-for="(item,index) in list"> //当选择的等于当前id才显示 <image v-if="selected.indexOf(item) >= 0"></image> <image
阅读全文
posted @ 2023-05-25 17:36 爱吃变态辣
阅读(33)
评论(0)
推荐(0)
单选事件自定义
摘要: <template> <view @click="onSelect(item,index) in list"> //当选择的等于当前id才显示 <image v-if="select = item.id"></image> <image v-else></image> </view> </templ
阅读全文
posted @ 2023-05-25 17:21 爱吃变态辣
阅读(17)
评论(0)
推荐(0)
点击全局取消显示
摘要: mounted() { let _this = this document.addEventListener("click", function(e) { if (e.target.className != "点击的类名") { _this.$nextTick(() => { //被点击绑定的变量
阅读全文
posted @ 2023-05-25 14:24 爱吃变态辣
阅读(27)
评论(0)
推荐(0)
连点限制
摘要: data(){ return{ xianzhi:0 } } fun(){ let now = new Date().getTime(); //获取当前时间戳 if((now - this.xianzhi) < 2000){ console.log('点击频繁') //限制两秒内点击多次检测 retu
阅读全文
posted @ 2023-05-25 08:58 爱吃变态辣
阅读(39)
评论(0)
推荐(0)
2023年4月26日
uniapp获取到当前设备高度与宽度和当前元素距离顶部的距离
摘要: 获取到当前设备的宽度和高度 uni.getSystemInfo({ success: function (res) {console.log(res.windowHeight) console.log(res.windowWidth) } }) 当前元素距离顶部的距离 uni.createSelec
阅读全文
posted @ 2023-04-26 17:23 爱吃变态辣
阅读(1756)
评论(0)
推荐(0)
下一页
公告