2020-01-29 19:37:25 +00:00
|
|
|
<template>
|
2022-06-20 08:38:49 +00:00
|
|
|
<MkStickyContainer>
|
2022-06-22 07:29:21 +00:00
|
|
|
<template #header><MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/></template>
|
2023-04-12 02:40:08 +00:00
|
|
|
<div>
|
2022-07-01 14:33:47 +00:00
|
|
|
<div v-if="tab === 'featured'">
|
|
|
|
<XFeatured/>
|
|
|
|
</div>
|
2022-07-13 09:09:41 +00:00
|
|
|
<div v-else-if="tab === 'users'">
|
|
|
|
<XUsers/>
|
2022-07-01 14:33:47 +00:00
|
|
|
</div>
|
2023-02-22 05:43:18 +00:00
|
|
|
<div v-else-if="tab === 'roles'">
|
|
|
|
<XRoles/>
|
|
|
|
</div>
|
2022-07-01 14:33:47 +00:00
|
|
|
</div>
|
2022-06-20 08:38:49 +00:00
|
|
|
</MkStickyContainer>
|
2020-01-29 19:37:25 +00:00
|
|
|
</template>
|
|
|
|
|
2022-06-20 08:38:49 +00:00
|
|
|
<script lang="ts" setup>
|
2022-07-01 14:33:47 +00:00
|
|
|
import { computed, watch } from 'vue';
|
|
|
|
import XFeatured from './explore.featured.vue';
|
|
|
|
import XUsers from './explore.users.vue';
|
2023-02-22 05:43:18 +00:00
|
|
|
import XRoles from './explore.roles.vue';
|
2023-01-09 00:41:25 +00:00
|
|
|
import MkFoldableSection from '@/components/MkFoldableSection.vue';
|
2022-06-20 08:38:49 +00:00
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata';
|
|
|
|
import { i18n } from '@/i18n';
|
|
|
|
|
2023-01-02 04:19:32 +00:00
|
|
|
const props = withDefaults(defineProps<{
|
2022-06-20 08:38:49 +00:00
|
|
|
tag?: string;
|
2023-01-02 04:19:32 +00:00
|
|
|
initialTab?: string;
|
|
|
|
}>(), {
|
|
|
|
initialTab: 'featured',
|
|
|
|
});
|
2022-06-20 08:38:49 +00:00
|
|
|
|
2023-01-02 04:19:32 +00:00
|
|
|
let tab = $ref(props.initialTab);
|
2023-01-09 00:41:25 +00:00
|
|
|
let tagsEl = $shallowRef<InstanceType<typeof MkFoldableSection>>();
|
2022-06-20 08:38:49 +00:00
|
|
|
|
|
|
|
watch(() => props.tag, () => {
|
|
|
|
if (tagsEl) tagsEl.toggleContent(props.tag == null);
|
|
|
|
});
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2022-06-20 08:38:49 +00:00
|
|
|
const headerActions = $computed(() => []);
|
|
|
|
|
|
|
|
const headerTabs = $computed(() => [{
|
2022-07-01 14:33:47 +00:00
|
|
|
key: 'featured',
|
2022-12-19 10:01:30 +00:00
|
|
|
icon: 'ti ti-bolt',
|
2022-07-01 14:33:47 +00:00
|
|
|
title: i18n.ts.featured,
|
2022-06-20 08:38:49 +00:00
|
|
|
}, {
|
2022-07-13 09:09:41 +00:00
|
|
|
key: 'users',
|
2022-12-19 10:01:30 +00:00
|
|
|
icon: 'ti ti-users',
|
2022-07-01 14:33:47 +00:00
|
|
|
title: i18n.ts.users,
|
2023-02-22 05:43:18 +00:00
|
|
|
}, {
|
|
|
|
key: 'roles',
|
|
|
|
icon: 'ti ti-badges',
|
|
|
|
title: i18n.ts.roles,
|
2022-06-20 08:38:49 +00:00
|
|
|
}]);
|
|
|
|
|
|
|
|
definePageMetadata(computed(() => ({
|
|
|
|
title: i18n.ts.explore,
|
2022-12-19 10:01:30 +00:00
|
|
|
icon: 'ti ti-hash',
|
2022-06-20 08:38:49 +00:00
|
|
|
})));
|
2020-01-29 19:37:25 +00:00
|
|
|
</script>
|