提交 c8bac12f 编写于 作者: A AmyFoxFN

fix scroll minHeight bug

上级 52a56858
<template> <template>
<div ref="wrapper" class="cube-scroll-wrapper"> <div ref="wrapper" class="cube-scroll-wrapper">
<div class="cube-scroll-content"> <div class="cube-scroll-content">
<slot> <div ref="listWrapper">
<ul ref="list" class="cube-scroll-list"> <slot>
<li @click="clickItem(item)" class="cube-scroll-item border-bottom-1px" v-for="item in data">{{item}}</li> <ul class="cube-scroll-list">
</ul> <li @click="clickItem(item)" class="cube-scroll-item border-bottom-1px" v-for="item in data">{{item}}</li>
</slot> </ul>
</slot>
</div>
<slot name="pullup" :pullUpLoad="pullUpLoad" :isPullUpLoad="isPullUpLoad"> <slot name="pullup" :pullUpLoad="pullUpLoad" :isPullUpLoad="isPullUpLoad">
<div class="cube-pullup-wrapper" v-if="pullUpLoad"> <div class="cube-pullup-wrapper" v-if="pullUpLoad">
<div class="before-trigger" v-if="!isPullUpLoad"> <div class="before-trigger" v-if="!isPullUpLoad">
...@@ -97,6 +99,10 @@ ...@@ -97,6 +99,10 @@
refreshDelay: { refreshDelay: {
type: Number, type: Number,
default: 20 default: 20
},
listRef: {
type: String,
default: 'list'
} }
}, },
data() { data() {
...@@ -143,8 +149,8 @@ ...@@ -143,8 +149,8 @@
if (!this.$refs.wrapper) { if (!this.$refs.wrapper) {
return return
} }
if (this.$refs.list && (this.pullDownRefresh || this.pullUpLoad)) { if (this.$refs.listWrapper && (this.pullDownRefresh || this.pullUpLoad)) {
this.$refs.list.style.minHeight = `${getRect(this.$refs.wrapper).height + 1}px` this.$refs.listWrapper.style.minHeight = `${getRect(this.$refs.wrapper).height + 1}px`
} }
let options = Object.assign({}, DEFAULT_OPTIONS, { let options = Object.assign({}, DEFAULT_OPTIONS, {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册