mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-07-24 13:36:28 +00:00
Merge pull request #166 from nagisa77/codex/add-parameters-for-homepage-display
This commit is contained in:
@@ -97,6 +97,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ref, onMounted, watch } from 'vue'
|
import { ref, onMounted, watch } from 'vue'
|
||||||
|
import { useRoute } from 'vue-router'
|
||||||
import { stripMarkdown } from '../utils/markdown'
|
import { stripMarkdown } from '../utils/markdown'
|
||||||
import { API_BASE_URL } from '../main'
|
import { API_BASE_URL } from '../main'
|
||||||
import TimeManager from '../utils/time'
|
import TimeManager from '../utils/time'
|
||||||
@@ -117,11 +118,16 @@ export default {
|
|||||||
SearchDropdown
|
SearchDropdown
|
||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
const selectedCategory = ref('')
|
const route = useRoute()
|
||||||
|
const selectedCategory = ref(route.query.category || '')
|
||||||
const selectedTags = ref([])
|
const selectedTags = ref([])
|
||||||
|
if (route.query.tags) {
|
||||||
|
const t = Array.isArray(route.query.tags) ? route.query.tags.join(',') : route.query.tags
|
||||||
|
selectedTags.value = t.split(',').filter(v => v).map(v => isNaN(v) ? v : Number(v))
|
||||||
|
}
|
||||||
const isLoadingPosts = ref(false)
|
const isLoadingPosts = ref(false)
|
||||||
const topics = ref(['最新', '排行榜' /*, '热门', '类别'*/])
|
const topics = ref(['最新', '排行榜' /*, '热门', '类别'*/])
|
||||||
const selectedTopic = ref('最新')
|
const selectedTopic = ref(route.query.view === 'ranking' ? '排行榜' : '最新')
|
||||||
|
|
||||||
const articles = ref([])
|
const articles = ref([])
|
||||||
const page = ref(0)
|
const page = ref(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user