0.1.9 • Published 5 years ago

vue-classic-scroll v0.1.9

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

vue-classic-scroll

Vue scroll component based on better-scroll

中文文档

usage mode

npm i vue-classic-scroll

import Scroll from 'vue-classic-scroll'
import 'vue-classic-scroll/dist/index.css';

// Local or global registration

notice

I am very sorry that I am not familiar with webpack, so I use vue-cli3 for packaging. For tool reasons, please add some code in the Let's add some code to our babel.config.js file

babel.config.js

module.exports = {
 presets: [
   '@vue/app'
 ],
   sourceType: 'unambiguous'   // add this code
 }

example

  <div class="home">
    <Scroll 
      class="xue-hei"
      :length="nais.length"
      @downScroll="scroll"
    >
      <ul>
        <li v-for="item in nais" :key="item">{{item}}</li>
      </ul>
    </Scroll>
  </div>
</template>

<script>
export default {
  data(){
    return{
      nais:[]
    }
  },
  methods:{
    scroll(end){
      setTimeout(()=>{
        end() // Called after the event ends
      },1000)
    }
  },
}
</script>
<style>
.xue-hei{
  height: 200px; // Height must be defined
}
</style>

Common events and parameters

eventtypeexplain
downScrollfunctionThe drop-down triggers the event
upScrollfunctionPull up trigger event
parametertyperequiredexplain
optionsobjectfalseinitialization parameter. Support for better-scroll all parameters and events
classobjecttrueHeight must be defined
lengthnumbertrueLength of data
loadTextstring/arrayfalseThe text at load time
loadEndTextstring/arrayfalseThe text at the end of the load
startIconstring/arrayfalseIcon for drop-down
loadIconstring/arrayfalseIcon at load time
emptyTextstringfalseText displayed without data
emptyIconstringfalseIcon displayed when no data is available

better-scroll

versions

0.1.9 first version

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago