fix bug: 子组件内不应该用页面的onReachBottom。导致小程序下无效

pull/133/head
18602180658 2025-01-01 02:25:48 +08:00
parent 46ba5e6aef
commit 4b9ef94741
1 changed files with 4 additions and 3 deletions

View File

@ -23,6 +23,7 @@
scroll-y scroll-y
:style="[{ height: pageHeight + 'px' }]" :style="[{ height: pageHeight + 'px' }]"
v-if="state.categoryList?.length" v-if="state.categoryList?.length"
@scrolltolower="handleScrollToLower"
> >
<image <image
v-if="state.categoryList[state.activeMenu].picUrl" v-if="state.categoryList[state.activeMenu].picUrl"
@ -61,7 +62,7 @@
import sheep from '@/sheep'; import sheep from '@/sheep';
import CategoryApi from '@/sheep/api/product/category'; import CategoryApi from '@/sheep/api/product/category';
import SpuApi from '@/sheep/api/product/spu'; import SpuApi from '@/sheep/api/product/spu';
import { onLoad, onReachBottom } from '@dcloudio/uni-app'; import { onLoad } from '@dcloudio/uni-app';
import { computed, reactive } from 'vue'; import { computed, reactive } from 'vue';
import _ from 'lodash-es'; import _ from 'lodash-es';
import { handleTree } from '@/sheep/util'; import { handleTree } from '@/sheep/util';
@ -140,9 +141,9 @@
onMenu(foundCategory ? state.categoryList.indexOf(foundCategory) : 0); onMenu(foundCategory ? state.categoryList.indexOf(foundCategory) : 0);
}); });
onReachBottom(() => { function handleScrollToLower() {
loadMore(); loadMore();
}); };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>