data-load-scroll
v1.1.0
Published
A Vue.js project
Downloads
3
Readme
data-load-scroll
A Vue.js components
数据滚动加载-超流畅平滑加载
install
npm i data-load-scroll
Import
Import for global usage
import App from './App.vue'
import DataLoadScroll from 'data-load-scroll'
Vue.use(DataLoadScroll)
Or on a single component
Usage
# html
<data-load-scroll :list="list">
<ul style="padding: 0; margin: 0">
<li v-for="(item, index) in list" :key="index">
<span>{{ item.time }}</span>
<span style="padding-left: 20px">{{ item.data }}</span>
</li>
</ul>
</data-load-scroll>
# js
getInit() {
const norList = [];
for (var i = 0; i < 4; i++) {
norList.push({
time: +new Date(),
data: "动画帧requestAnimationFrame / 取消动画帧cancelAnimationFrame(index)",
});
}
this.list = this.list.concat(norList);
},