mirror of
https://github.com/youzan/vant.git
synced 2025-10-22 11:54:02 +00:00
[new feature] List: add finished-text prop (#2131)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user