ScrollView.vue 776 Bytes
<template>
  <div :class="['scroll-view', ScrollViewclass]">
    <van-list
      v-model="loading"
      :finished="finished"
      finished-text="到底啦!!"
      @load="onLoad"
      offset="100"
      :immediate-check="false"
    >
      <slot></slot>
    </van-list>
  </div>
</template>

<script type='text/ecmascript-6'>
export default {
  name: 'ScrollView',
  data () {
    return {
      loading: false,
      finished: false,
    }
  },
  props: ['ScrollViewclass'],
  mounted () {
  },
  methods: {
    onLoad () {
      console.log('触底')
      this.loading = false
      this.finished = true
      this.$emit('ReachBottom', null)
    },
  }
}
</script>

<style scoped lang='scss'>
.scroll-view {
  overflow-y: scroll;
  box-sizing: border-box;
}
</style>