chore: add ranking page

This commit is contained in:
Hakadao
2023-10-15 04:55:08 +08:00
parent fb1bbd75b3
commit a547f14636
4 changed files with 31 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ import { setupMomentMsgLstnr } from './moment'
import { setupHistoryMsgLstnr } from './history'
import { setupFavoriteMsgLstnr } from './favorite'
import { setupWatchLaterMsgLstnr } from './watchLater'
import { setupRankingMsgLstnr } from './ranking'
export function setupAllMsgLstnrs() {
setupAuthMsgLstnr()
@@ -20,4 +21,5 @@ export function setupAllMsgLstnrs() {
setupFavoriteMsgLstnr()
setupAnimeMsgLstnr()
setupWatchLaterMsgLstnr()
setupRankingMsgLstnr()
}

View File

@@ -0,0 +1,15 @@
import browser from 'webextension-polyfill'
function handleMessage(message: any) {
}
function handleConnect() {
browser.runtime.onMessage.removeListener(handleMessage)
browser.runtime.onMessage.addListener(handleMessage)
}
export function setupRankingMsgLstnr() {
browser.runtime.onConnect.removeListener(handleConnect)
browser.runtime.onConnect.addListener(handleConnect)
}

View File

@@ -2,6 +2,7 @@
import ForYou from './components/ForYou.vue'
import Following from './components/Following.vue'
import Trending from './components/Trending.vue'
import Ranking from './components/Ranking.vue'
import emitter from '~/utils/mitt'
import { settings } from '~/logic'
@@ -9,9 +10,9 @@ const handleBackToTop = inject('handleBackToTop') as () => void
const recommendContentKey = ref<string>(`recommendContent${Number(new Date())}`)
const activatedPage = ref<'ForYou' | 'Following' | 'Trending'>('ForYou')
const pages = { ForYou, Following, Trending }
const pages = { ForYou, Following, Trending, Ranking }
const tabs = reactive<{ label: string; value: 'ForYou' | 'Following' | 'Trending' }[]>([
const tabs = reactive<{ label: string; value: 'ForYou' | 'Following' | 'Trending' | 'Ranking' }[]>([
{
label: 'For you',
value: 'ForYou',
@@ -24,6 +25,10 @@ const tabs = reactive<{ label: string; value: 'ForYou' | 'Following' | 'Trending
label: 'Trending',
value: 'Trending',
},
{
label: 'Ranking',
value: 'Ranking',
},
])
watch(() => activatedPage.value, () => {

View File

@@ -0,0 +1,7 @@
<script setup lang="ts">
</script>
<template>
ranking
</template>