2020-01-30 04:37:25 +09:00
|
|
|
<template>
|
2020-03-21 00:21:33 +09:00
|
|
|
<div class="cxiknjgy" :class="{ autoMargin }">
|
2020-01-30 04:37:25 +09:00
|
|
|
<slot :items="items"></slot>
|
|
|
|
<div class="empty" v-if="empty" key="_empty_">
|
|
|
|
<slot name="empty"></slot>
|
|
|
|
</div>
|
2020-05-31 12:53:06 +09:00
|
|
|
<div class="more" v-show="more" key="_more_">
|
|
|
|
<mk-button class="button" ref="loadMore" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }" primary>
|
2020-07-25 01:56:52 +09:00
|
|
|
<template v-if="!moreFetching">{{ $t('loadMore') }}</template>
|
2020-02-12 02:52:37 +09:00
|
|
|
<template v-if="moreFetching"><mk-loading inline/></template>
|
2020-01-30 04:37:25 +09:00
|
|
|
</mk-button>
|
|
|
|
</div>
|
2020-03-21 00:21:33 +09:00
|
|
|
</div>
|
2020-01-30 04:37:25 +09:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
|
|
|
import MkButton from './button.vue';
|
|
|
|
import paging from '../../scripts/paging';
|
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
components: {
|
|
|
|
MkButton
|
|
|
|
},
|
|
|
|
|
2020-08-01 10:02:37 +09:00
|
|
|
mixins: [
|
|
|
|
paging({}),
|
|
|
|
],
|
|
|
|
|
2020-01-30 04:37:25 +09:00
|
|
|
props: {
|
|
|
|
pagination: {
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
autoMargin: {
|
|
|
|
required: false,
|
|
|
|
default: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.cxiknjgy {
|
|
|
|
&.autoMargin > *:not(:last-child) {
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
|
|
|
@media (max-width: 500px) {
|
|
|
|
margin-bottom: 8px;
|
|
|
|
}
|
|
|
|
}
|
2020-02-12 02:52:37 +09:00
|
|
|
|
|
|
|
> .more > .button {
|
|
|
|
margin-left: auto;
|
|
|
|
margin-right: auto;
|
|
|
|
height: 48px;
|
|
|
|
min-width: 150px;
|
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
|
|
|
</style>
|