1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-18 21:15:31 +02:00

refactor(frontend): MkTabの指定をpropsから行うように (#16596)

* refactor(frontend): MkTabの指定をpropsから行うように

* Update explore.featured.vue
This commit is contained in:
かっこかり
2025-10-05 15:48:11 +09:00
committed by GitHub
parent f89b4cdc12
commit 720c6519cd
6 changed files with 112 additions and 77 deletions

View File

@@ -5,9 +5,14 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<div class="_spacer" style="--MI_SPACER-w: 800px;">
<MkTab v-model="tab" style="margin-bottom: var(--MI-margin);">
<option value="notes">{{ i18n.ts.notes }}</option>
<option value="polls">{{ i18n.ts.poll }}</option>
<MkTab
v-model="tab"
:tabs="[
{ key: 'notes', label: i18n.ts.notes },
{ key: 'polls', label: i18n.ts.poll },
]"
style="margin-bottom: var(--MI-margin);"
>
</MkTab>
<MkNotesTimeline v-if="tab === 'notes'" :paginator="paginatorForNotes"/>
<MkNotesTimeline v-else-if="tab === 'polls'" :paginator="paginatorForPolls"/>
@@ -33,5 +38,5 @@ const paginatorForPolls = markRaw(new Paginator('notes/polls/recommendation', {
},
}));
const tab = ref('notes');
const tab = ref<'notes' | 'polls'>('notes');
</script>

View File

@@ -5,9 +5,15 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<div class="_spacer" style="--MI_SPACER-w: 1200px;">
<MkTab v-if="instance.federation !== 'none'" v-model="origin" style="margin-bottom: var(--MI-margin);">
<option value="local">{{ i18n.ts.local }}</option>
<option value="remote">{{ i18n.ts.remote }}</option>
<MkTab
v-if="instance.federation !== 'none'"
v-model="origin"
:tabs="[
{ key: 'local', label: i18n.ts.local },
{ key: 'remote', label: i18n.ts.remote },
]"
style="margin-bottom: var(--MI-margin);"
>
</MkTab>
<div v-if="origin === 'local'">
<template v-if="tag == null">
@@ -77,7 +83,7 @@ const props = defineProps<{
tag?: string;
}>();
const origin = ref('local');
const origin = ref<'local' | 'remote'>('local');
const tagsLocal = ref<Misskey.entities.Hashtag[]>([]);
const tagsRemote = ref<Misskey.entities.Hashtag[]>([]);

View File

@@ -39,10 +39,15 @@ SPDX-License-Identifier: AGPL-3.0-only
>
<MkStickyContainer>
<template #header>
<MkTab v-model="tab" :class="$style.tab">
<option value="users">{{ i18n.ts.users }}</option>
<option value="notes">{{ i18n.ts.notes }}</option>
<option value="all">{{ i18n.ts.all }}</option>
<MkTab
v-model="tab"
:tabs="[
{ key: 'users', label: i18n.ts.users },
{ key: 'notes', label: i18n.ts.notes },
{ key: 'all', label: i18n.ts.all },
]"
:class="$style.tab"
>
</MkTab>
</template>
<div v-if="tab === 'users'" :class="[$style.users, '_margin']" style="padding-bottom: var(--MI-margin);">

View File

@@ -6,11 +6,16 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<MkStickyContainer>
<template #header>
<MkTab v-model="tab" :class="$style.tab">
<option value="featured">{{ i18n.ts.featured }}</option>
<option value="notes">{{ i18n.ts.notes }}</option>
<option value="all">{{ i18n.ts.all }}</option>
<option value="files">{{ i18n.ts.withFiles }}</option>
<MkTab
v-model="tab"
:tabs="[
{ key: 'featured', label: i18n.ts.featured },
{ key: 'notes', label: i18n.ts.notes },
{ key: 'all', label: i18n.ts.all },
{ key: 'files', label: i18n.ts.withFiles },
]"
:class="$style.tab"
>
</MkTab>
</template>
<MkNotesTimeline v-if="tab === 'featured'" :noGap="true" :paginator="featuredPaginator" :pullToRefresh="false" :class="$style.tl"/>
@@ -30,7 +35,7 @@ const props = defineProps<{
user: Misskey.entities.UserDetailed;
}>();
const tab = ref<string>('all');
const tab = ref<'featured' | 'notes' | 'all' | 'files'>('all');
const featuredPaginator = markRaw(new Paginator('users/featured-notes', {
limit: 10,

View File

@@ -8,11 +8,16 @@ SPDX-License-Identifier: AGPL-3.0-only
<div :class="$style.root">
<MkStickyContainer>
<template #header>
<MkTab v-model="tab" :class="$style.tab">
<option value="featured">{{ i18n.ts.featured }}</option>
<option value="notes">{{ i18n.ts.notes }}</option>
<option value="all">{{ i18n.ts.all }}</option>
<option value="files">{{ i18n.ts.withFiles }}</option>
<MkTab
v-model="tab"
:tabs="[
{ key: 'featured', label: i18n.ts.featured },
{ key: 'notes', label: i18n.ts.notes },
{ key: 'all', label: i18n.ts.all },
{ key: 'files', label: i18n.ts.withFiles },
]"
:class="$style.tab"
>
</MkTab>
</template>
<MkNotesTimeline v-if="tab === 'featured'" :noGap="true" :paginator="featuredPaginator" :class="$style.tl"/>
@@ -34,7 +39,7 @@ const props = defineProps<{
user: Misskey.entities.UserDetailed;
}>();
const tab = ref<string>('all');
const tab = ref<'featured' | 'notes' | 'all' | 'files'>('all');
const featuredPaginator = markRaw(new Paginator('users/featured-notes', {
limit: 10,