mintui infinite scroll的使用

邹祺
2023-12-01

示例:

main.js部分:
先引入mintui,再引入Infinite scroll

import Mint from 'mint-ui';
import 'mint-ui/lib/style.css'
Vue.use(Mint);
import { InfiniteScroll } from 'mint-ui';
Vue.use(InfiniteScroll);

html部分:

<div class="content" v-infinite-scroll="loadMore" infinite-scroll-disabled="loading" infinite-scroll-distance="10">
      <div class="item relative" v-for="item in list" @click="detail(item.id)">
        <div class="title">{{item.title}}</div>
        <div class="time">{{item.createTime}}</div>
        <img class="bigger" src="../assets/img/bigger.jpg" width="12" alt>
      </div>
    </div>

css部分:

.content {
  overflow: scroll;/*不写会报错*/
}
 类似资料: