This commit is contained in:
parent
fc88410c0d
commit
3451c9a0de
|
@ -4,42 +4,34 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Transition
|
<MkLoading v-if="fetching"/>
|
||||||
:enterActiveClass="prefer.s.animation ? $style.transition_fade_enterActive : ''"
|
|
||||||
:leaveActiveClass="prefer.s.animation ? $style.transition_fade_leaveActive : ''"
|
|
||||||
:enterFromClass="prefer.s.animation ? $style.transition_fade_enterFrom : ''"
|
|
||||||
:leaveToClass="prefer.s.animation ? $style.transition_fade_leaveTo : ''"
|
|
||||||
mode="out-in"
|
|
||||||
>
|
|
||||||
<MkLoading v-if="fetching"/>
|
|
||||||
|
|
||||||
<MkError v-else-if="error" @retry="init()"/>
|
<MkError v-else-if="error" @retry="init()"/>
|
||||||
|
|
||||||
<div v-else-if="empty" key="_empty_" class="empty">
|
<div v-else-if="empty" key="_empty_" class="empty">
|
||||||
<slot name="empty">
|
<slot name="empty">
|
||||||
<div class="_fullinfo">
|
<div class="_fullinfo">
|
||||||
<img :src="infoImageUrl" draggable="false"/>
|
<img :src="infoImageUrl" draggable="false"/>
|
||||||
<div>{{ i18n.ts.nothing }}</div>
|
<div>{{ i18n.ts.nothing }}</div>
|
||||||
</div>
|
|
||||||
</slot>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-else ref="rootEl" class="_gaps">
|
|
||||||
<div v-show="pagination.reversed && more" key="_more_">
|
|
||||||
<MkButton v-if="!moreFetching" v-appear="(enableInfiniteScroll && !props.disableAutoLoad) ? appearFetchMoreAhead : null" :class="$style.more" :wait="moreFetching" primary rounded @click="fetchMoreAhead">
|
|
||||||
{{ i18n.ts.loadMore }}
|
|
||||||
</MkButton>
|
|
||||||
<MkLoading v-else class="loading"/>
|
|
||||||
</div>
|
|
||||||
<slot :items="Array.from(items.values())" :fetching="fetching || moreFetching"></slot>
|
|
||||||
<div v-show="!pagination.reversed && more" key="_more_">
|
|
||||||
<MkButton v-if="!moreFetching" v-appear="(enableInfiniteScroll && !props.disableAutoLoad) ? appearFetchMore : null" :class="$style.more" :wait="moreFetching" primary rounded @click="fetchMore">
|
|
||||||
{{ i18n.ts.loadMore }}
|
|
||||||
</MkButton>
|
|
||||||
<MkLoading v-else class="loading"/>
|
|
||||||
</div>
|
</div>
|
||||||
|
</slot>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else ref="rootEl" class="_gaps">
|
||||||
|
<div v-show="pagination.reversed && more" key="_more_">
|
||||||
|
<MkButton v-if="!moreFetching" v-appear="(enableInfiniteScroll && !props.disableAutoLoad) ? appearFetchMoreAhead : null" :class="$style.more" :wait="moreFetching" primary rounded @click="fetchMoreAhead">
|
||||||
|
{{ i18n.ts.loadMore }}
|
||||||
|
</MkButton>
|
||||||
|
<MkLoading v-else class="loading"/>
|
||||||
</div>
|
</div>
|
||||||
</Transition>
|
<slot :items="Array.from(items.values())" :fetching="fetching || moreFetching"></slot>
|
||||||
|
<div v-show="!pagination.reversed && more" key="_more_">
|
||||||
|
<MkButton v-if="!moreFetching" v-appear="(enableInfiniteScroll && !props.disableAutoLoad) ? appearFetchMore : null" :class="$style.more" :wait="moreFetching" primary rounded @click="fetchMore">
|
||||||
|
{{ i18n.ts.loadMore }}
|
||||||
|
</MkButton>
|
||||||
|
<MkLoading v-else class="loading"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
@ -491,15 +483,6 @@ defineExpose({
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" module>
|
<style lang="scss" module>
|
||||||
.transition_fade_enterActive,
|
|
||||||
.transition_fade_leaveActive {
|
|
||||||
transition: opacity 0.125s ease;
|
|
||||||
}
|
|
||||||
.transition_fade_enterFrom,
|
|
||||||
.transition_fade_leaveTo {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.more {
|
.more {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
|
|
Loading…
Reference in New Issue