Skip to content

Commit

Permalink
fix: check window.$message
Browse files Browse the repository at this point in the history
  • Loading branch information
chansee97 committed Jun 7, 2024
1 parent 02ce656 commit ec85ffa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/store/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ export const useRouteStore = defineStore('route-store', {
// Initialize route information
const rowRoutes = await this.initRouteInfo()
if (!rowRoutes) {
window.$message.error($t(`app.getRouteError`))
// Check if the message variable is defined
if (window.$message)
window.$message.error($t(`app.getRouteError`))
else
throw new Error($t(`app.getRouteError`))

return
}
this.rowRoutes = rowRoutes
Expand Down

0 comments on commit ec85ffa

Please sign in to comment.