摘要: 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)
摘要: <template> <view> 循环请求的数据 </view> <view> {{ isLoading ? 加载中...' : '没有更多了' }} </view> </template> export default { data(){ return{ dataForm:[ ],//分页数据 阅读全文
posted @ 2023-06-30 10:03 爱吃变态辣 阅读(85) 评论(0) 推荐(0)
摘要: 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)
摘要: <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)
摘要: 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)
摘要: <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)
摘要: 获取到当前设备的宽度和高度 uni.getSystemInfo({ success: function (res) {console.log(res.windowHeight) console.log(res.windowWidth) } }) 当前元素距离顶部的距离 uni.createSelec 阅读全文
posted @ 2023-04-26 17:23 爱吃变态辣 阅读(1756) 评论(0) 推荐(0)