12345678910111213141516171819202122232425262728293031323334353637 |
- <template>
-
- <mescroll-body ref="mescrollRef" top="100" @init="mescrollInit" @down="downCallback" @up="upCallback">
-
- <good-list :list="goods"></good-list>
- </mescroll-body>
- </template>
- <script>
- import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
- import {apiGoods} from "@/api/mock.js"
-
- export default {
- mixins: [MescrollMixin],
- data() {
- return {
- goods: []
- }
- },
- methods: {
-
- upCallback(page) {
-
- apiGoods(page.num, page.size).then(curPageData=>{
-
- this.mescroll.endSuccess(curPageData.length);
-
- if(page.num == 1) this.goods = [];
- this.goods=this.goods.concat(curPageData);
- }).catch(()=>{
-
- this.mescroll.endErr();
- })
- }
- }
- }
- </script>
|