mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-06-06 01:57:34 +08:00
refactor: per-request mobile detection
This commit is contained in:
@@ -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)) {
|
||||
|
||||
@@ -120,7 +120,7 @@ import { API_BASE_URL, toast } from '../../../main'
|
||||
import { getToken, authState } from '../../../utils/auth'
|
||||
import TimeManager from '../../../utils/time'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { isMobile } from '../../../utils/screen'
|
||||
import { useIsMobile } from '../../../utils/screen'
|
||||
import Dropdown from '../../../components/Dropdown.vue'
|
||||
|
||||
export default {
|
||||
@@ -149,6 +149,7 @@ export default {
|
||||
const subscribed = ref(false)
|
||||
const commentSort = ref('NEWEST')
|
||||
const isFetchingComments = ref(false)
|
||||
const isMobile = useIsMobile()
|
||||
|
||||
// record default metadata from the main document (client only)
|
||||
const defaultTitle = process.client ? document.title : ''
|
||||
|
||||
Reference in New Issue
Block a user