refactor: per-request mobile detection

This commit is contained in:
Tim
2025-08-08 18:12:40 +08:00
parent 25a64d7666
commit 27a2591904
7 changed files with 47 additions and 41 deletions

View File

@@ -120,7 +120,7 @@ import TagSelect from '~/components/TagSelect.vue'
import ArticleTags from '~/components/ArticleTags.vue'
import ArticleCategory from '~/components/ArticleCategory.vue'
import SearchDropdown from '~/components/SearchDropdown.vue'
import { isMobile } from '~/utils/screen'
import { useIsMobile } from '~/utils/screen'
export default {
name: 'HomePageView',
@@ -166,6 +166,7 @@ export default {
const pageSize = 10
const allLoaded = useState('index-allLoaded', () => false)
const initialized = useState('index-initialized', () => false)
const isMobile = useIsMobile()
const loadOptions = async () => {
if (selectedCategory.value && !isNaN(selectedCategory.value)) {