<template>
<div class="scroll-wapper" :style="{height: scrollHeight + 'px'}" id="scroll-ul">
<ul class="list" v-infinite-scroll="loadMore" infinite-scroll-disabled="loading"
infinite-scroll-distance="10">
<slot>
<div class="tip">
<div class="logo">
<img v-if="tip.img" :src="tip.img"/>
<span v-if="tip.icon" class="iconfont" v-html="tip.icon"></span>
</div>
<p>{{tip.title}}</p>
<button v-if="tip.btn" @click="go">{{tip.btn}}</button>
</div>
</slot>
</ul>
</div>
</template>
<script>
import { InfiniteScroll, Indicator } from "mint-ui";
import defaultImg from "../../../assets/images/good-tip.png"; export default {
data() {
return {
length: true
// height: {
// height: this.scrollHeight
// }
};
},
mounted() {
// console.log(this.scrollHeight)
},
methods: {
loadMore() {
this.loadingHandle();
this.$emit("loadMore");
},
loadingHandle() {
Indicator.open({
text: "加载中",
spinnerType: "fading-circle"
});
}, },
props: {
loading: {
type: Boolean,
default() {
return false;
}
},
tip: {
type: Object,
default() {
return {
img: defaultImg,
title: "暂时没有哦!",
btn: ""
};
}
},
scrollHeight: {
type: Number,
default() {
return 200;
}
}
}
};
</script>

外部需传入scrollHeight属性,是该滚动容器的高度,后可以根据实际情况使用

最新文章

  1. [HTML5] ArrayBuffer与类型化数组
  2. SQL怎么输出前n个记录? n是中间计算得到的,不支持变量传递
  3. qt 4.6.2 与visual studio 2005 集成(编译方法,以及中间遇到的问题)
  4. 2.里氏替换原则(Liskov Substitution Principle)
  5. 对 Sea.js 进行配置(一) seajs.config
  6. 云计算服务模型,第 1 部分: 基础架构即服务(IaaS)
  7. systemtap 列出所有linux 内核模块与相关函数2
  8. CentOS源码安装搭建LNMP全过程(包括nginx,mysql,php,svn)【转】
  9. [视频转换] C#VideoConvert视频转换帮助类 (转载)
  10. CC++初学者编程教程(4) 安装Oracle12c于Windows Sever2012
  11. DDD实践(一)
  12. html学习笔记 - 标签
  13. C语言运算符运算顺序判断实例1
  14. UVA 11292 Dragon of Loowater(简单贪心)
  15. Oracle课程档案,第二天
  16. 最短路径spfa
  17. 0006-20180422-自动化第七章-python基础学习笔记
  18. MySQL空间索引简单使用
  19. Nginx常用功能
  20. Web安全颜色

热门文章

  1. &amp;&amp;的运算顺序
  2. python蒙特卡洛脚本模拟—挑战者号爆炸概率
  3. python3 以utf-8编码写文件
  4. HTTP学习记录:三、状态码
  5. gitlab+jenkins 搭建
  6. Cygwin 技巧
  7. Canvas入门05-渐变颜色
  8. Linux 查看CPU 核数 还有 CPU 个数的命令
  9. 并发编程时守护进程在pycharm与python shell中的运行结果不同
  10. CSP-S全国模拟赛第二场 【nan】