资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

如何使用vue实现滑动到底部加载更多效果

这篇文章主要介绍了如何使用vue实现滑动到底部加载更多效果,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。

创新互联-云计算及IDC服务提供商,涵盖公有云、IDC机房租用、成都西云数据中心、等保安全、私有云建设等企业级互联网基础服务,服务电话:028-86922220

思路:

如果可视区的高度域dom元素的getBoundingClientRect().bottom高度相同说明已经到了底部,可以实现加载了

template:

script:

style:


 .content {
  .isbottom {
   display: flex;
   align-items: center;
   justify-content: center;
   padding: 15px 0;
   color: #999;
   i {
    font-size: 30px;
    animation: rotate 1s infinite;
   }
   span {
    color: #ccc;
    padding-left: 15px;
   }
  }
  .logo {
   background: #fff;
   padding-bottom: 15px;
   div {
    &:nth-child(1) {
     display: flex;
     justify-content: center;
     img {
      width: 60px;
      height: 60px;
     }
    }
    &:nth-child(2) {
     text-align: center;
     padding: 15px 15px;
     color: #609bf0;
    }
    &:nth-child(3) {
     display: flex;
     justify-content: center;
     align-items: center;
     color: #1296db;
     border: #1296db 1PX solid;
     width: 50%;
     margin: 0 auto;
     padding: 5px 0;
     font-size: 15px;
     img {
      width: 20px;
      height: 20px;
      margin-right: 8px;
     }
    }
   }
  }
  .info {
   background: #fff;
   margin-bottom: 10px;
   padding-bottom: 15px;
   .swipe {
    height: 300px;
    background: #eee;
    position: relative;
    .jcc {
     display: flex;
     justify-content: center;
     height: 300px;
    }
    img {
     // width: 100%;
     height: 100%;
    }
    .index {
     position: absolute;
     background: rgba(243, 244, 245, .8);
     padding: 5px 15px;
     bottom: 10px;
     right: 10px;
     border-radius: 50px;
    }
   }
  }
  .info1 {
   background: #fff;
   position: relative;
   padding: 15px 9px 0;
   height: 79px;
   overflow: hidden;
   p {
    line-height: 22px;
    text-indent: 2em;
    letter-spacing: 1.2px;
   }
   span {
    width: 75px;
    text-align: right;
    position: absolute;
    bottom: 0;
    right: 9px;
    color: #39c;
    background: #fff;
    i {
     color: #333;
    }
   }
  }
  .shopping {
   background: #fff;
   padding-top: 15px;
   h5 {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 10px;
    >img {
     width: 30px;
     height: 30px;
     margin-right: 10px;
    }
    span {
     color: #0f589e;
     font-weight: normal;
    }
   }
   img {
    display: block;
    width: 100%;
    height: 2px;
   }
  }
  .listUl {
   // display: flex;
   // flex-wrap: wrap;
   padding: 0 15px;
   top: 60px;
   height: calc(100% - 100px) !important;
   background: #fff;
   overflow: hidden;
   .itemLIST {
    // float: left;
    width: 50%;
    display: inline-block;
    padding-top: 15px;
    padding-bottom: 15px;
    &:nth-child(2n) {
     padding-right: 5px;
    }
    &:nth-child(2n -1) {
     padding-left: 5px;
    }
    img {
     // width: 100%;
     height: 100%;
     /* prettier-ignore */
     // border: 1PX solid #eee;
    }
    div {
     &:first-child {
      overflow: hidden;
      height: 160px;
      display: flex;
      align-items: center;
      justify-content: center;
     }
     &:last-child {
      h4 {
       font-weight: normal;
       font-size: 16px;
       margin-top: 5px;
       text-overflow: ellipsis;
       white-space: nowrap;
       overflow: hidden;
      }
      p {
       font-size: 14px;
       margin-top: 5px;
       display: flex;
       align-items: center;
       justify-content: space-between; // padding: 0 15px;
       padding-right: 10px;
       span {
        display: block;
        &:first-child {
         color: #888;
        }
        &:last-child {
         color: red;
         font-size: 16px;
        }
       }
      }
     }
    }
   }
  }
 }

感谢你能够认真阅读完这篇文章,希望小编分享的“如何使用vue实现滑动到底部加载更多效果”这篇文章对大家有帮助,同时也希望大家多多支持创新互联,关注创新互联行业资讯频道,更多相关知识等着你来学习!


当前标题:如何使用vue实现滑动到底部加载更多效果
地址分享:http://cdkjz.cn/article/pcgihj.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220