diff --git a/src/router/index.ts b/src/router/index.ts index 2371c89..e374167 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -22,6 +22,11 @@ router.beforeEach(async (to, from, next) => { console.log('to:', to.path) isLoading.value = true + if (to.path === '/') { + next({ + name: 'device', + }) + } next() }) diff --git a/src/router/index.ts b/src/router/index.ts index 2371c89..e374167 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -22,6 +22,11 @@ router.beforeEach(async (to, from, next) => { console.log('to:', to.path) isLoading.value = true + if (to.path === '/') { + next({ + name: 'device', + }) + } next() }) diff --git a/src/views/page/result/index.vue b/src/views/page/result/index.vue index 51c9147..caa674e 100644 --- a/src/views/page/result/index.vue +++ b/src/views/page/result/index.vue @@ -108,6 +108,16 @@ }) } fetchDict() + +const imgHeight = ref(160) +onMounted(() => { + const width = window.innerWidth * 0.22 + imgHeight.value = (9 * width) / 16 +}) +window.addEventListener('resize', () => { + const width = window.innerWidth * 0.22 + imgHeight.value = (9 * width) / 16 +})