又爽又高潮的BB视频免费看,久久99精品久久久久子伦,男女性杂交内射女BBWXZ,新激情五月天

18842388900

網(wǎng)站建設(shè) APP開發(fā) 小程序

Article/文章

記錄成長點(diǎn)滴 分享您我感悟

您當(dāng)前位置>首頁 > 知識 > 軟件開發(fā)

小程序?qū)嵗喝绾巫远x下拉刷新

發(fā)表時間:2019-05-20 08:50:43

文章來源:沈陽網(wǎng)站建設(shè)

標(biāo)簽:小程序

分享:

瀏覽次數(shù):0

本篇文章給大家?guī)淼膬?nèi)容是關(guān)于小程序實(shí)例:如何自定義下拉刷新,有一定的參考價值,有需要的朋友可以參考一下,希望對你有所幫助。

自定義組件:

js:

// components/test/test.jsComponent({/*** 組件的屬性列表*/properties: { }, /*** 組件的初始數(shù)據(jù)*/data: {scrollHeight: 0,startY: 0,tips: '下拉刷新',isRefreshing: false}, /*** 組件的方法列表*/methods: {end: function(e) {if (this.data.isRefreshing) {return}if (this.data.scrollHeight >= 50) {this.setData({scrollHeight: 50,tips: '正在刷新',isRefreshing: true})this.triggerEvent('onRefresh')} else {this.setData({scrollHeight: 0,tips: '下拉刷新'})}},move: function(e) {if (this.data.isRefreshing) {return} var that = this;var moveY = e.touches[0].pageY;var dY = moveY - that.data.startY;console.log(dY);if (dY >= 50 && dY <= 80) {this.setData({tips: '松開加載',scrollHeight: dY})} else if (dY > 80) {this.setData({tips: '松開加載',scrollHeight: 80})} else {this.setData({tips: '下拉刷新',scrollHeight: dY})} }, start: function(e) {this.data.startY = e.touches[0].pageY;}, stopRefres沈陽小程序開發(fā)

<a href=http://www.gz-jiupin.com target=_blank class=infotextkey>沈陽<a href=http://www.gz-jiupin.com target=_blank class=infotextkey>軟件開發(fā)</a></a>,<a href=http://www.gz-jiupin.com target=_blank class=infotextkey>沈陽<a href=http://www.gz-jiupin.com target=_blank class=infotextkey>軟件公司</a></a>

h: function() {this.setData({isRefreshing: false,scrollHeight: -50})},}})

wxml:

<!--components/test/test.wxml--><view class='loading-container' bindtouchend='end' bindtouchmove='move' bindtouchstart='start' style='margin-top:{{scrollHeight}}px;transform:translateY(-50px);' ><view class="weui-loadmore" style='margin:0 auto;padding:1.5em 0;'><view class="weui-loading"></view><view class="weui-loadmore__tips">{{tips}}</view></view></view>

wxss:其中引用了weui 這個用不用都無所謂的很簡單的

@import '/pages/common/weui.wxss';page{height: 100%;} .loading-container{height: 100%;}

pages里wxml:

<loadmore style='height:100%;' bindonRefresh='onRefresh' id='loadmore'></loadmore>

js://刷新方法回調(diào)

onRefresh: function() {var that = this;setTimeout(function(){that.selectComponent("#loadmore").stopRefresh();},3000)},json:{"enablePullDownRefresh": false,"usingComponents":{"loadmore":"../../components/test/test"}}

以上就是小程序實(shí)例:如何自定義下拉刷新的詳細(xì)內(nèi)容,更多請關(guān)注沈陽網(wǎng)站建設(shè)其它相關(guān)文章!

小程序

相關(guān)案例查看更多

无码国产精成人午夜视频| 啊灬啊灬啊灬快灬高潮少妇| 18禁免费无码无遮挡网站| 成年免费人香蕉视频在线| 亚洲AV无码专区国产乱码在线观看 | 亚洲色最新高清AV网站|