-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
12 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# 通用环境变量 | ||
|
||
# 标题 | ||
VITE_APP_TITLE = Vite App 🎉 | ||
VITE_APP_TITLE = tov | ||
|
||
|
||
# markdown 渲染支持 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# 开发时环境变量 | ||
|
||
# 标题 | ||
# VITE_APP_TITLE = Vite App 🎉 | ||
# VITE_APP_TITLE = tov | ||
|
||
|
||
# 开发时 Inspect 调试支持 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# 生产时环境变量 | ||
|
||
# 标题 | ||
# VITE_APP_TITLE = Vite App 🎉 | ||
# VITE_APP_TITLE = tov | ||
|
||
|
||
# 生产时 mock 支持 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { router } from './router' | ||
|
||
const title = useTitle(import.meta.env.VITE_APP_TITLE) | ||
|
||
router.beforeEach((r) => { | ||
const originTitle = import.meta.env.VITE_APP_TITLE | ||
const name = r.name?.toString().toLowerCase() | ||
title.value = name === 'index' ? originTitle : `${originTitle} | ${name}` | ||
}) |