当前位置: 首页 > news >正文

嵊州哪里可以做网站镇江丹阳

嵊州哪里可以做网站,镇江丹阳,建设厅网站平顶山,wordpress写 a href效果图 在app或者小程序中向下滑动 会出现刷新数据 ,而上拉到底 需要更新数据 功能实现 主要俩种方式 依赖生命周期 在page.json中开启 page.json style : {navigationBarTitleText : 小小练习,backgroundTextStyle: style : {navigationBarTitleText : 小小练习,backgroundTextStyle: dark,enablePullDownRefresh: true}开启后页面监听onPullDownRefresh()顶部下拉事件,onReachBottom触底事件 templateview classcontentview v-for(item, index) in cats :keyindeximage :style{ width: item.width/2 rpx, height: item.height/2 rpx } :srcitem.url/image/view/viewview classfloatview classitem顶部/viewview classitem刷新/view/view /templatescript setup import { reactive, onMounted } from vue;const cats reactive([]); onPullDownRefresh(() {console.log(触发下拉刷新了);// 进行下拉刷新的操作比如重新加载数据等refresh(); // 这里调用你封装的刷新数据的方法uni.stopPullDownRefresh(); }); onReachBottom((){console.log(触底时间)PullDownRefresh() })const PullDownRefresh ((){uni.showLoading({title:加载中,duration:1000})console.log(触发滑动区域刷新了)// 停止当前页面下拉刷新refresh()}) const addrefresh(){console.log(滑动到进行更新)uni.request({url: https://api.thecatapi.com/v1/images/search?limit2,success(res) {console.log(获取接口成功, res);// cats.length 0; // 不清空清空数组res.data.forEach(item {cats.push(item); // 将接口数据逐个添加到cats数组中});},fail: (e) {console.log(获取接口失败);}});} const refresh(){uni.request({url: https://api.thecatapi.com/v1/images/search?limit2,success(res) {console.log(获取接口成功, res);cats.length 0; // 不清空清空数组res.data.forEach(item {cats.push(item); // 将接口数据逐个添加到cats数组中});},fail: (e) {console.log(获取接口失败);}}); } onMounted(() { refresh() }); /scriptstyle langscss scoped /* 样式 */ .float{position: absolute;right: 30rpx;bottom: 100rpx;.item{width: 90rpx;height: 90rpx;background: rgba(165, 213, 255, 0.0);border-radius: 50%;align-items: center;justify-content: center;padding-bottom: env(safe-area-inset-bottom);display: flex;border: 1px solid rebeccapurple;margin-bottom: 15rpx;} } /style 依赖滚动视图组件 主要依赖这俩个事件 templatescroll-view scrolltoupperPullDownRefresh scroll-ytrue styleheight: 1080rpx; classscroll-Y scrolltoloweraddrefreshview v-for(item, index) in cats :keyindeximage :style{ width: item.width/2 rpx, height: item.height/2 rpx } :srcitem.url/image/view/scroll-viewview classfloatview classitem顶部/viewview classitem刷新/view/view /templatescript setup import { reactive, onMounted } from vue;const cats reactive([]);const PullDownRefresh ((){uni.showLoading({title:加载中,duration:1000})console.log(触发滑动区域刷新了)// 停止当前页面下拉刷新refresh()}) const addrefresh(){console.log(滑动到进行更新)uni.request({url: https://api.thecatapi.com/v1/images/search?limit2,success(res) {console.log(获取接口成功, res);// cats.length 0; // 不清空清空数组res.data.forEach(item {cats.push(item); // 将接口数据逐个添加到cats数组中});},fail: (e) {console.log(获取接口失败);}});} const refresh(){uni.request({url: https://api.thecatapi.com/v1/images/search?limit2,success(res) {console.log(获取接口成功, res);cats.length 0; // 不清空清空数组res.data.forEach(item {cats.push(item); // 将接口数据逐个添加到cats数组中});},fail: (e) {console.log(获取接口失败);}}); } onMounted(() { refresh() }); /script这种方式没有自带的动画 并且需要设置滑动区域的高度,不然可能滑倒底部没数据了但是由于没有到组件底部无法触发事件 当上拉更新数据过多时,想要在滑动顶部进行更新数据时候,就需要滑动很长事件,所以可以使用uni.pageScrollTo(OBJECT) 快速到达页面指定位置
http://www.dnsts.com.cn/news/126077.html

相关文章:

  • 网站开发投入资金找人帮你做ppt的网站吗
  • 网站建设建站网温州网站网站建设
  • 中山手机网站设计零基础自学做网站
  • 网站优化 保定视频制作网站怎么做
  • 怎样做网贷网站网站设计制作说明
  • 代网站备案费用吗资深的金融行业网站开发
  • 建设通属于官方网站浙江网站建设有哪些
  • 重庆重庆网站建设公司湘西建设监理协会网站
  • 如何建设一个视频小网站中国品牌vi设计公司
  • 新泰网站建设流程自己开发app所需的各种费用
  • 建站合同深圳学校网站建设报价
  • 如何用百度搜自己做的网站网站外链哪里做
  • 上海市建设咨询协会网站深圳工业设计公司哪家好
  • php网站开发 实战教程如何开科技软件
  • php网站源代码宁波专业建网站外包
  • 怎么把网站源码上传到空间根目录视频桂林龙胜网站建设
  • 深圳企业黄页网南京seo顾问
  • 网站定制设计师安阳哪里做360网站
  • 国外网站平台有哪些wordpress关闭GZIP
  • 做苗木比较好的网站中国广告网
  • 北京网站建设有哪些浩森宇特邢台专业网站建设推荐
  • 想学做网站需要学什么个体工商户年审营业执照
  • php网站后台制作烟台做网站公司
  • 无锡微网站开发怎么把微信公众号的文章wordpress
  • 做折页的网站上海网站建设seo
  • 上海模板网站建站网络营销导向企业网站建设的原则包括
  • 企业网站推广和营销网页推广区别云南省建设厅网站二级建造师
  • 供水开发建设公司网站龙岩属于哪里
  • 哪个学校有网站建设公司企业模板wordpress模板
  • 做网站用什么开源程序营销型网站手机端