[new feature] List: add finished-text prop (#2131)

This commit is contained in:
neverland
2018-11-24 08:10:34 +08:00
committed by GitHub
parent 58f3bddbaa
commit c8967fc8ed
8 changed files with 80 additions and 52 deletions

View File

@@ -2,14 +2,20 @@
<div :class="b()">
<slot />
<div
v-show="loading"
v-if="loading"
:class="b('loading')"
>
<slot name="loading">
<loading />
<loading :class="b('loading-icon')" />
<span :class="b('loading-text')">{{ loadingText || $t('loadingTip') }}</span>
</slot>
</div>
<div
v-if="finished && finishedText"
:class="b('finished-text')"
>
{{ finishedText }}
</div>
</div>
</template>
@@ -28,6 +34,8 @@ export default create({
props: {
loading: Boolean,
finished: Boolean,
loadingText: String,
finishedText: String,
immediateCheck: {
type: Boolean,
default: true
@@ -35,8 +43,7 @@ export default create({
offset: {
type: Number,
default: 300
},
loadingText: String
}
},
mounted() {
@@ -81,7 +88,11 @@ export default create({
const scrollerHeight = utils.getVisibleHeight(scroller);
/* istanbul ignore next */
if (!scrollerHeight || utils.getComputedStyle(el).display === 'none' || el.offsetParent === null) {
if (
!scrollerHeight ||
utils.getComputedStyle(el).display === 'none' ||
el.offsetParent === null
) {
return;
}