feat: 网页title根据路由动态变化

This commit is contained in:
taoran
2023-11-29 18:59:45 +08:00
parent a3f5cf6f2d
commit 7279a85274
7 changed files with 283 additions and 18 deletions
+9
View File
@@ -3,6 +3,7 @@ import vue from '@vitejs/plugin-vue'
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
import {viteMockServe} from 'vite-plugin-mock'
import path from 'path'
import { createHtmlPlugin } from 'vite-plugin-html'
// https://vitejs.dev/config/
export default defineConfig(({command, mode}) => {
@@ -20,6 +21,14 @@ export default defineConfig(({command, mode}) => {
viteMockServe({
localEnabled: command === 'serve',
}),
//修改html插件
createHtmlPlugin({
inject: {
data: {
title: env.VITE_APP_TITLE
}
}
})
],
resolve: {
alias: {