Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
a26db8b3
Commit
a26db8b3
authored
Dec 18, 2025
by
shaw
Browse files
fix: 修复前端页面刷新时偶发空白渲染的竞态条件问题
使用 router.isReady() 等待路由器完成初始导航后再挂载应用, 避免 RouterView 在路由未就绪时渲染空的 Comment 节点。
parent
8e81e395
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend/src/main.ts
View file @
a26db8b3
...
...
@@ -9,4 +9,8 @@ const app = createApp(App)
app
.
use
(
createPinia
())
app
.
use
(
router
)
app
.
use
(
i18n
)
app
.
mount
(
'
#app
'
)
// 等待路由器完成初始导航后再挂载,避免竞态条件导致的空白渲染
router
.
isReady
().
then
(()
=>
{
app
.
mount
(
'
#app
'
)
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment