mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-09-06 16:07:14 +08:00
feat: no side padding when isMobile (#54)
* feat: no side padding when isMobile * feat: no side padding when isMobile
This commit is contained in:
@@ -5,14 +5,13 @@ import { darkTheme, NGlobalStyle } from 'naive-ui'
|
|||||||
import { zhCN } from 'naive-ui'
|
import { zhCN } from 'naive-ui'
|
||||||
import { computed, onMounted } from 'vue'
|
import { computed, onMounted } from 'vue'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
|
|
||||||
import Content from './views/Content.vue'
|
|
||||||
import Header from './views/Header.vue'
|
|
||||||
import { useGlobalState } from './store'
|
import { useGlobalState } from './store'
|
||||||
|
import { useIsMobile } from './utils/composables'
|
||||||
|
|
||||||
const { localeCache, themeSwitch, loading } = useGlobalState()
|
const { localeCache, themeSwitch, loading } = useGlobalState()
|
||||||
const theme = computed(() => themeSwitch.value ? darkTheme : null)
|
const theme = computed(() => themeSwitch.value ? darkTheme : null)
|
||||||
const localeConfig = computed(() => localeCache.value == 'zh' ? zhCN : null)
|
const localeConfig = computed(() => localeCache.value == 'zh' ? zhCN : null)
|
||||||
|
const isMobile = useIsMobile()
|
||||||
|
|
||||||
const { locale } = useI18n({
|
const { locale } = useI18n({
|
||||||
useScope: 'global',
|
useScope: 'global',
|
||||||
@@ -39,14 +38,14 @@ onMounted(async () => {
|
|||||||
<n-global-style />
|
<n-global-style />
|
||||||
<n-spin description="loading..." :show="loading">
|
<n-spin description="loading..." :show="loading">
|
||||||
<n-message-provider>
|
<n-message-provider>
|
||||||
<n-grid x-gap="12" :cols="8">
|
<n-grid x-gap="12" :cols="12">
|
||||||
<n-gi span="1"></n-gi>
|
<n-gi v-if="!isMobile" span="1"></n-gi>
|
||||||
<n-gi span="6">
|
<n-gi :span="isMobile ? 12 : 10">
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<router-view></router-view>
|
<router-view></router-view>
|
||||||
</div>
|
</div>
|
||||||
</n-gi>
|
</n-gi>
|
||||||
<n-gi span="1"></n-gi>
|
<n-gi v-if="!isMobile" span="1"></n-gi>
|
||||||
</n-grid>
|
</n-grid>
|
||||||
<n-back-top :right="100" />
|
<n-back-top :right="100" />
|
||||||
</n-message-provider>
|
</n-message-provider>
|
||||||
|
|||||||
Reference in New Issue
Block a user