| | |
| | | |
| | | <template> |
| | | <scroll-view |
| | | :id="elmId" |
| | | class="c-infinite-scroll" |
| | | :scrollY="true" |
| | | lowerThreshold="100" |
| | | @scroll="evt=>onScroll(evt)" |
| | | @touchstart="evt=>onTouch(evt)" |
| | | @touchmove="evt=>onTouch(evt)" |
| | | @touchend="evt=>onTouch(evt)" |
| | | @scrollToLower="evt=>onScrollToLower(evt)" |
| | | lowerThreshold="100" |
| | | > |
| | | <view |
| | | class="c-infinite-top" |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import Taro from '@tarojs/taro'; |
| | | import { AtActivityIndicator } from 'taro-ui-vue'; |
| | | import { Tools } from '@components/common/Tools'; |
| | | import './cInfiniteScroll.scss'; |
| | | |
| | | export default { |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | elmId: 'cis-' + Tools.createGUID(), |
| | | // 初始化状态 |
| | | inital: false, |
| | | // 当前页面 |
| | |
| | | }, |
| | | // 刷新加载 |
| | | $refresh() { |
| | | Taro.pageScrollTo({ |
| | | selector: '#' + this.elmId, |
| | | scrollTop: 0, |
| | | }); |
| | | this.ending = false; |
| | | this.current = 0; |
| | | this.hanldeLoadMore(); |