pub-list-scroll.vue 956 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <scroll-view class="scroll-view" @scrolltolower="onScrollTolower" scroll-y>
  3. <slot />
  4. <uni-load-more v-if="(loaded&&status!='noMore')||(!loaded && status=='noMore')" :status="status"
  5. :content-text="contentText" />
  6. <view class="blank"></view>
  7. </scroll-view>
  8. </template>
  9. <script setup>
  10. import {
  11. ref,
  12. computed
  13. } from 'vue';
  14. const emit = defineEmits(['next'])
  15. const props = defineProps({
  16. loaded: {
  17. type: Boolean,
  18. default: false
  19. },
  20. status: {
  21. type: String,
  22. default: "loading"
  23. },
  24. text: {
  25. type: String,
  26. default: "数据加载中..."
  27. }
  28. })
  29. const contentText = computed(() => {
  30. let _text = {
  31. contentdown: props.text,
  32. contentrefresh: props.text,
  33. contentnomore: '没有更多数据了',
  34. }
  35. return _text;
  36. })
  37. //顶部tab点击
  38. const onScrollTolower = () => {
  39. emit('next')
  40. }
  41. </script>
  42. <style lang="scss" scoped>
  43. .scroll-view {
  44. .blank {
  45. height: 1rpx;
  46. width: 100%;
  47. }
  48. }
  49. </style>