优化:将路由改为Hash模式,大屏预览新窗口打开,修复滚动条问题

This commit is contained in:
yuantao
2026-01-16 18:20:15 +08:00
parent 46756f2501
commit e2f9871199
4 changed files with 23 additions and 14 deletions

View File

@@ -1,7 +1,7 @@
import { createRouter, createWebHistory } from 'vue-router' import { createRouter, createWebHashHistory } from 'vue-router'
const router = createRouter({ const router = createRouter({
history: createWebHistory(), history: createWebHashHistory(),
routes: [ routes: [
{ {
path: '/', path: '/',

View File

@@ -223,9 +223,9 @@ onMounted(async () => {
await store.initialize() await store.initialize()
}) })
// 跳转到大屏展示页面 // 跳转到大屏展示页面(新窗口)
const goToDisplay = () => { const goToDisplay = () => {
router.push('/display') window.open('/#/display', '_blank')
} }
// 快捷键指南 // 快捷键指南

View File

@@ -281,14 +281,17 @@ onUnmounted(() => {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
overflow: hidden; overflow: hidden;
padding: 0 40px; padding: 0;
box-sizing: border-box;
} }
.scroll-list { .scroll-list {
display: grid; display: grid;
gap: 30px; gap: 30px;
width: 100%; width: calc(100% - 80px);
max-width: 1600px; max-width: 1600px;
padding: 0 40px;
box-sizing: border-box;
} }
.scroll-item { .scroll-item {
@@ -307,8 +310,9 @@ onUnmounted(() => {
.scroll-name { .scroll-name {
white-space: pre-line; white-space: pre-line;
word-wrap: break-word; word-wrap: break-word;
word-break: break-all; word-break: break-word;
width: 100%; width: 100%;
overflow-wrap: break-word;
} }
/* 结果模式 */ /* 结果模式 */
@@ -319,15 +323,18 @@ onUnmounted(() => {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 0 40px; padding: 0;
box-sizing: border-box;
} }
.winners-list { .winners-list {
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(3, 1fr);
gap: 30px; gap: 30px;
width: 100%; width: calc(100% - 80px);
max-width: 1600px; max-width: 1600px;
padding: 0 40px;
box-sizing: border-box;
} }
.winner-item { .winner-item {
@@ -346,7 +353,8 @@ onUnmounted(() => {
.winner-name { .winner-name {
white-space: pre-line; white-space: pre-line;
word-wrap: break-word; word-wrap: break-word;
word-break: break-all; word-break: break-word;
width: 100%; width: 100%;
overflow-wrap: break-word;
} }
</style> </style>

View File

@@ -4,11 +4,12 @@ import path from 'path'
export default defineConfig({ export default defineConfig({
plugins: [vue()], plugins: [vue()],
base: '.',
resolve: { resolve: {
alias: { alias: {
'@': path.resolve(__dirname, './src'), '@': path.resolve(__dirname, './src'),
'@utils': path.resolve(__dirname, './utils') '@utils': path.resolve(__dirname, './utils'),
}, },
extensions: ['.js', '.ts', '.jsx', '.tsx', '.json', '.vue'] extensions: ['.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
} },
}) })