PC端样式更新
This commit is contained in:
@@ -3,14 +3,11 @@
|
||||
<div class="loadingBox" v-if="state.dataloading">
|
||||
<van-loading class="loading" color="#fff" vertical>加载中...</van-loading>
|
||||
</div>
|
||||
<div v-else>
|
||||
<mobile v-if="isMobile" />
|
||||
<pc v-else />
|
||||
</div>
|
||||
<mobile v-else />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onUnmounted, reactive } from 'vue';
|
||||
import { reactive } from 'vue';
|
||||
import { useAppStore } from '@/stores/app';
|
||||
import { useConfigStore } from '@/stores/config';
|
||||
import { useUserStore } from '@/stores/user';
|
||||
@@ -22,9 +19,7 @@ import { AdType, SourceType } from '@/enums/app';
|
||||
import axios from 'axios';
|
||||
import AppApi from '@/service/app';
|
||||
import mobile from './../mobile/index.vue';
|
||||
import pc from './../pc/index.vue';
|
||||
|
||||
const isMobile = ref(false);
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const appStore = useAppStore();
|
||||
@@ -42,25 +37,6 @@ const state = reactive({
|
||||
dataloading: true,
|
||||
});
|
||||
|
||||
const setDeviceType = () => {
|
||||
isMobile.value = window.innerWidth <= 768;
|
||||
// if (isMobile.value) {
|
||||
// router.push('/home')
|
||||
// } else {
|
||||
// router.push('/welfare')
|
||||
// }
|
||||
};
|
||||
|
||||
setDeviceType();
|
||||
// 监听屏幕大小变化
|
||||
window.addEventListener('resize', () => {
|
||||
setDeviceType();
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', setDeviceType);
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 如果没有用户ID就生成一个
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user