2020-01-29 19:37:25 +00:00
|
|
|
<template>
|
2021-12-02 11:09:12 +00:00
|
|
|
<MkSpacer :content-max="700">
|
|
|
|
<div v-if="tab === 'featured'" class="rknalgpo">
|
|
|
|
<MkPagination v-slot="{items}" :pagination="featuredPagesPagination">
|
|
|
|
<MkPagePreview v-for="page in items" :key="page.id" class="ckltabjg" :page="page"/>
|
|
|
|
</MkPagination>
|
|
|
|
</div>
|
2020-11-17 05:59:15 +00:00
|
|
|
|
2021-12-02 11:09:12 +00:00
|
|
|
<div v-else-if="tab === 'my'" class="rknalgpo my">
|
|
|
|
<MkButton class="new" @click="create()"><i class="fas fa-plus"></i></MkButton>
|
|
|
|
<MkPagination v-slot="{items}" :pagination="myPagesPagination">
|
|
|
|
<MkPagePreview v-for="page in items" :key="page.id" class="ckltabjg" :page="page"/>
|
|
|
|
</MkPagination>
|
|
|
|
</div>
|
2020-07-28 01:08:08 +00:00
|
|
|
|
2021-12-02 11:09:12 +00:00
|
|
|
<div v-else-if="tab === 'liked'" class="rknalgpo">
|
|
|
|
<MkPagination v-slot="{items}" :pagination="likedPagesPagination">
|
|
|
|
<MkPagePreview v-for="like in items" :key="like.page.id" class="ckltabjg" :page="like.page"/>
|
|
|
|
</MkPagination>
|
2021-10-23 19:03:07 +00:00
|
|
|
</div>
|
|
|
|
</MkSpacer>
|
2020-01-29 19:37:25 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-12-02 11:09:12 +00:00
|
|
|
import { computed, defineComponent } from 'vue';
|
2021-11-11 17:02:25 +00:00
|
|
|
import MkPagePreview from '@/components/page-preview.vue';
|
|
|
|
import MkPagination from '@/components/ui/pagination.vue';
|
|
|
|
import MkButton from '@/components/ui/button.vue';
|
|
|
|
import * as symbols from '@/symbols';
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2020-10-17 11:12:00 +00:00
|
|
|
export default defineComponent({
|
2020-01-29 19:37:25 +00:00
|
|
|
components: {
|
2021-12-02 11:09:12 +00:00
|
|
|
MkPagePreview, MkPagination, MkButton
|
2020-01-29 19:37:25 +00:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2021-12-02 11:09:12 +00:00
|
|
|
[symbols.PAGE_INFO]: computed(() => ({
|
2020-12-26 01:47:36 +00:00
|
|
|
title: this.$ts.pages,
|
2021-04-20 14:22:59 +00:00
|
|
|
icon: 'fas fa-sticky-note',
|
2021-10-09 03:33:08 +00:00
|
|
|
bg: 'var(--bg)',
|
2021-04-10 15:03:31 +00:00
|
|
|
actions: [{
|
2021-04-20 14:22:59 +00:00
|
|
|
icon: 'fas fa-plus',
|
2021-04-10 15:03:31 +00:00
|
|
|
text: this.$ts.create,
|
2021-10-09 03:33:08 +00:00
|
|
|
handler: this.create,
|
|
|
|
}],
|
2021-12-02 11:09:12 +00:00
|
|
|
tabs: [{
|
|
|
|
active: this.tab === 'featured',
|
|
|
|
title: this.$ts._pages.featured,
|
|
|
|
icon: 'fas fa-fire-alt',
|
|
|
|
onClick: () => { this.tab = 'featured'; },
|
|
|
|
}, {
|
|
|
|
active: this.tab === 'my',
|
|
|
|
title: this.$ts._pages.my,
|
|
|
|
icon: 'fas fa-edit',
|
|
|
|
onClick: () => { this.tab = 'my'; },
|
|
|
|
}, {
|
|
|
|
active: this.tab === 'liked',
|
|
|
|
title: this.$ts._pages.liked,
|
|
|
|
icon: 'fas fa-heart',
|
|
|
|
onClick: () => { this.tab = 'liked'; },
|
|
|
|
},]
|
|
|
|
})),
|
2020-11-17 05:59:15 +00:00
|
|
|
tab: 'featured',
|
|
|
|
featuredPagesPagination: {
|
2022-01-12 17:26:10 +00:00
|
|
|
endpoint: 'pages/featured' as const,
|
2020-11-17 05:59:15 +00:00
|
|
|
noPaging: true,
|
|
|
|
},
|
2020-01-29 19:37:25 +00:00
|
|
|
myPagesPagination: {
|
2022-01-12 17:26:10 +00:00
|
|
|
endpoint: 'i/pages' as const,
|
2020-01-29 19:37:25 +00:00
|
|
|
limit: 5,
|
|
|
|
},
|
|
|
|
likedPagesPagination: {
|
2022-01-12 17:26:10 +00:00
|
|
|
endpoint: 'i/page-likes' as const,
|
2020-01-29 19:37:25 +00:00
|
|
|
limit: 5,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
create() {
|
2020-11-17 05:59:15 +00:00
|
|
|
this.$router.push(`/pages/new`);
|
2020-01-29 19:37:25 +00: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>
|