vue-mercury-better-scroll
v1.0.2
Published
a scroll component for Mobile(H5) based on better-scroll(thanks to vue-slim-better-scroll<https://github.com/wannaxiao/vue-slim-better-scroll>
Downloads
8
Maintainers
Readme
vue-mercury-better-scroll
基于 [better-scroll] thanks to vue-slim-better-scroll(https://github.com/ustbhuangyi/better-scroll)
安装
npm i -S vue-mercury-better-scroll
引入
- 插件形式全局引入
// 入口文件 main.js 中
import Scroll from 'vue-mercury-better-scroll'
Vue.use(Scroll)
- 组件形式引入
// *.vue 中
import Scroll from 'vue-mercury-better-scroll'
export default {
/* ... */
components: {
Scroll,
},
/* ... */
}
使用
<!-- 简单场景 -->
<Scroll
ref="scroll"
:autoUpdate="true"
@pullingDown="loadRefresh"
@pullingUp="loadMore">
<!-- 滚动的内容 -->
</Scroll>
<!-- 复杂场景 -->
<Scroll
ref="scroll"
:updateData="[data]"
:refreshData="[]"
@pullingDown="loadRefresh"
@pullingUp="loadMore">
<!-- 滚动的内容 -->
</Scroll>
设置
<!-- 较 vue-slim-better-scroll 增加 loading 动画插槽 -->
<div slot="pullupLoading">pull up loading</div>
<div slot="pulldownLoading">pull down loading</div>