mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-04-21 03:17:28 +08:00
fix: 优化首页tabs排序
This commit is contained in:
@@ -155,17 +155,22 @@ const route = useRoute()
|
|||||||
const tagOptions = ref([])
|
const tagOptions = ref([])
|
||||||
const categoryOptions = ref([])
|
const categoryOptions = ref([])
|
||||||
|
|
||||||
const topics = ref(['精选', '最新回复', '最新', '排行榜' /*, '热门', '类别'*/])
|
const topics = ref(['最新回复', '最新', '精选', '排行榜' /*, '热门', '类别'*/])
|
||||||
const selectedTopicCookie = useCookie('homeTab')
|
const selectedTopicCookie = useCookie('homeTab')
|
||||||
const selectedTopic = ref(
|
|
||||||
selectedTopicCookie.value
|
let defaultTopic = '最新回复'
|
||||||
? selectedTopicCookie.value
|
|
||||||
: route.query.view === 'ranking'
|
if (selectedTopicCookie.value) {
|
||||||
? '排行榜'
|
defaultTopic = selectedTopicCookie.value
|
||||||
: route.query.view === 'latest'
|
} else if (route.query.view === 'ranking') {
|
||||||
? '最新'
|
defaultTopic = '排行榜'
|
||||||
: '最新回复',
|
} else if (route.query.view === 'latest') {
|
||||||
)
|
defaultTopic = '最新'
|
||||||
|
} else if (route.query.view === 'featured') {
|
||||||
|
defaultTopic = '精选'
|
||||||
|
}
|
||||||
|
const selectedTopic = ref(defaultTopic)
|
||||||
|
|
||||||
if (!selectedTopicCookie.value) selectedTopicCookie.value = selectedTopic.value
|
if (!selectedTopicCookie.value) selectedTopicCookie.value = selectedTopic.value
|
||||||
const articles = ref([])
|
const articles = ref([])
|
||||||
const page = ref(0)
|
const page = ref(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user