1.0.1 • Published 4 years ago

page-scroll-bottom v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

我这是自用 组件滑动到底部

main.js
import Vue from 'vue'
import App from './App.vue'
import scrollPageBottom from "page-scroll-bottom"
Vue.use(scrollPageBottom)

page.vue

 pageId 单页面多个组件时候使用

 @on-scrollbottom  滑动到底部出发  
 
 heigt 接收高度
 
 宽度会撑满

<template>
  <div id="app">
    <ScrollBottom pageId="pageId"  @on-scrollbottom="scrollbottom" height="100vh">
      <p v-for="item in list" class="psss"></p>
    </ScrollBottom>
  </div>
</template>

<script>
// import HelloWorld from "./components/HelloWorld.vue";

export default {
  name: "App",
  data() {
    return {
      list: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
    };
  },
  components: {},
  methods: {
    scrollbottom(d) {
      this.list = [...this.list, ...[2, 3, 4, 5]];
    }
  }
};
</script>