2020-01-30 04:37:25 +09:00
|
|
|
<template>
|
2021-10-24 04:03:07 +09:00
|
|
|
<MkSpacer>
|
|
|
|
<!-- TODO: MkHeaderに統合 -->
|
2021-11-19 19:36:12 +09:00
|
|
|
<MkTab v-if="$i" v-model="tab">
|
2021-10-24 04:03:07 +09:00
|
|
|
<option value="featured"><i class="fas fa-fire-alt"></i> {{ $ts._pages.featured }}</option>
|
|
|
|
<option value="my"><i class="fas fa-edit"></i> {{ $ts._pages.my }}</option>
|
|
|
|
<option value="liked"><i class="fas fa-heart"></i> {{ $ts._pages.liked }}</option>
|
|
|
|
</MkTab>
|
2021-10-09 12:33:08 +09:00
|
|
|
|
2021-10-24 04:03:07 +09:00
|
|
|
<div class="_section">
|
2021-11-19 19:36:12 +09:00
|
|
|
<div v-if="tab === 'featured'" class="rknalgpo _content">
|
|
|
|
<MkPagination #default="{items}" :pagination="featuredPagesPagination">
|
|
|
|
<MkPagePreview v-for="page in items" :key="page.id" class="ckltabjg" :page="page"/>
|
2021-10-24 04:03:07 +09:00
|
|
|
</MkPagination>
|
|
|
|
</div>
|
2020-11-17 14:59:15 +09:00
|
|
|
|
2021-11-19 19:36:12 +09:00
|
|
|
<div v-if="tab === 'my'" class="rknalgpo _content my">
|
2021-10-24 04:03:07 +09:00
|
|
|
<MkButton class="new" @click="create()"><i class="fas fa-plus"></i></MkButton>
|
2021-11-19 19:36:12 +09:00
|
|
|
<MkPagination #default="{items}" :pagination="myPagesPagination">
|
|
|
|
<MkPagePreview v-for="page in items" :key="page.id" class="ckltabjg" :page="page"/>
|
2021-10-24 04:03:07 +09:00
|
|
|
</MkPagination>
|
|
|
|
</div>
|
2020-07-28 10:08:08 +09:00
|
|
|
|
2021-11-19 19:36:12 +09:00
|
|
|
<div v-if="tab === 'liked'" class="rknalgpo _content">
|
|
|
|
<MkPagination #default="{items}" :pagination="likedPagesPagination">
|
|
|
|
<MkPagePreview v-for="like in items" :key="like.page.id" class="ckltabjg" :page="like.page"/>
|
2021-10-24 04:03:07 +09:00
|
|
|
</MkPagination>
|
2020-10-18 21:21:52 +09:00
|
|
|
</div>
|
2021-10-24 04:03:07 +09:00
|
|
|
</div>
|
|
|
|
</MkSpacer>
|
2020-01-30 04:37:25 +09:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-10-17 20:12:00 +09:00
|
|
|
import { defineComponent } from 'vue';
|
2021-11-12 02:02:25 +09:00
|
|
|
import MkPagePreview from '@/components/page-preview.vue';
|
|
|
|
import MkPagination from '@/components/ui/pagination.vue';
|
|
|
|
import MkButton from '@/components/ui/button.vue';
|
|
|
|
import MkTab from '@/components/tab.vue';
|
|
|
|
import * as symbols from '@/symbols';
|
2020-01-30 04:37:25 +09:00
|
|
|
|
2020-10-17 20:12:00 +09:00
|
|
|
export default defineComponent({
|
2020-01-30 04:37:25 +09:00
|
|
|
components: {
|
2020-07-28 10:08:08 +09:00
|
|
|
MkPagePreview, MkPagination, MkButton, MkTab
|
2020-01-30 04:37:25 +09:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2021-04-10 12:54:12 +09:00
|
|
|
[symbols.PAGE_INFO]: {
|
2020-12-26 10:47:36 +09:00
|
|
|
title: this.$ts.pages,
|
2021-04-20 23:22:59 +09:00
|
|
|
icon: 'fas fa-sticky-note',
|
2021-10-09 12:33:08 +09:00
|
|
|
bg: 'var(--bg)',
|
2021-04-11 00:03:31 +09:00
|
|
|
actions: [{
|
2021-04-20 23:22:59 +09:00
|
|
|
icon: 'fas fa-plus',
|
2021-04-11 00:03:31 +09:00
|
|
|
text: this.$ts.create,
|
2021-10-09 12:33:08 +09:00
|
|
|
handler: this.create,
|
|
|
|
}],
|
2020-10-17 20:12:00 +09:00
|
|
|
},
|
2020-11-17 14:59:15 +09:00
|
|
|
tab: 'featured',
|
|
|
|
featuredPagesPagination: {
|
|
|
|
endpoint: 'pages/featured',
|
|
|
|
noPaging: true,
|
|
|
|
},
|
2020-01-30 04:37:25 +09:00
|
|
|
myPagesPagination: {
|
|
|
|
endpoint: 'i/pages',
|
|
|
|
limit: 5,
|
|
|
|
},
|
|
|
|
likedPagesPagination: {
|
|
|
|
endpoint: 'i/page-likes',
|
|
|
|
limit: 5,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
create() {
|
2020-11-17 14:59:15 +09:00
|
|
|
this.$router.push(`/pages/new`);
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.rknalgpo {
|
|
|
|
&.my .ckltabjg:first-child {
|
|
|
|
margin-top: 16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.ckltabjg:not(:last-child) {
|
|
|
|
margin-bottom: 8px;
|
|
|
|
}
|
|
|
|
|
|
|
|
@media (min-width: 500px) {
|
|
|
|
.ckltabjg:not(:last-child) {
|
|
|
|
margin-bottom: 16px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|