index.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <view class="index-box">
  3. <index-nav @setTabNum="setTabNum"></index-nav>
  4. <view class="list-box">
  5. <view class="box-one" v-if="tabNum===0">
  6. <slide-item></slide-item>
  7. </view>
  8. <view class="box-two" v-else-if="tabNum===1">
  9. <attachment-list ref="attachmentObj"></attachment-list>
  10. </view>
  11. <view class="box-three" v-else>
  12. <attachment-list></attachment-list>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. import IndexNav from "@/pages/index/model/index-nav";
  19. import AttachmentList from "@/pages/index/model/attachment-list";
  20. import SlideItem from "@/pages/index/model/slide-item";
  21. export default {
  22. components: {SlideItem, AttachmentList, IndexNav},
  23. data() {
  24. return {
  25. tabNum:0
  26. }
  27. },
  28. onReachBottom(){
  29. if(this.tabNum===1){
  30. this.$refs.attachmentObj.getAttachmentList()
  31. }
  32. },
  33. methods: {
  34. setTabNum(tabNum){
  35. this.tabNum=tabNum
  36. }
  37. }
  38. }
  39. </script>
  40. <style scoped lang="scss">
  41. .index-box{
  42. overflow: hidden;
  43. -webkit-overflow-scrolling: touch;
  44. overscroll-behavior: none;
  45. height: 100vh ;
  46. width: 100vw;
  47. .box-one{
  48. }
  49. }
  50. </style>