Skip to content

Commit 7dd3692

Browse files
committed
chore(demo): revise page title
1 parent e2d3cc9 commit 7dd3692

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

demo/vue2.6/vite.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { ConfigEnv, UserConfigExport } from 'vite'
22
import { createVuePlugin } from 'vite-plugin-vue2'
33
import ScriptSetup from 'unplugin-vue2-script-setup/vite'
44
import AutoImport from 'unplugin-auto-import/vite'
5+
import { name } from '../../package.json'
56

67
// https://vitejs.dev/config/
78
export default ({ command }: ConfigEnv): UserConfigExport => {
@@ -33,7 +34,7 @@ export default ({ command }: ConfigEnv): UserConfigExport => {
3334
{
3435
name: 'html-transform',
3536
transformIndexHtml(html: string) {
36-
return html.replace(/\{\{VUE_VERSION\}\}/g, '2.6')
37+
return html.replace(/\{\{NAME\}\}/, name).replace(/\{\{VUE_VERSION\}\}/g, '2.6')
3738
},
3839
},
3940
],

demo/vue2.7/vite.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { ConfigEnv, UserConfigExport } from 'vite'
22
import vue from '@vitejs/plugin-vue2'
33
import AutoImport from 'unplugin-auto-import/vite'
4+
import { name } from '../../package.json'
45

56
// https://vitejs.dev/config/
67
export default ({ command }: ConfigEnv): UserConfigExport => {
@@ -31,7 +32,7 @@ export default ({ command }: ConfigEnv): UserConfigExport => {
3132
{
3233
name: 'html-transform',
3334
transformIndexHtml(html: string) {
34-
return html.replace(/\{\{VUE_VERSION\}\}/g, '2.7')
35+
return html.replace(/\{\{NAME\}\}/, name).replace(/\{\{VUE_VERSION\}\}/g, '2.7')
3536
},
3637
},
3738
],

demo/vue3/vite.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { ConfigEnv, UserConfigExport } from 'vite'
22
import vue from '@vitejs/plugin-vue'
33
import AutoImport from 'unplugin-auto-import/vite'
4+
import { name } from '../../package.json'
45

56
// https://vitejs.dev/config/
67
export default ({ command }: ConfigEnv): UserConfigExport => {
@@ -26,7 +27,7 @@ export default ({ command }: ConfigEnv): UserConfigExport => {
2627
{
2728
name: 'html-transform',
2829
transformIndexHtml(html: string) {
29-
return html.replace(/\{\{VUE_VERSION\}\}/g, '3')
30+
return html.replace(/\{\{NAME\}\}/, name).replace(/\{\{VUE_VERSION\}\}/g, '3')
3031
},
3132
},
3233
],

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta charset="UTF-8" />
66
<link rel="icon" href="/favicon.ico" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>Vue {{VUE_VERSION}}</title>
8+
<title>{{NAME}} + Vue {{VUE_VERSION}}</title>
99
</head>
1010

1111
<body>

0 commit comments

Comments
 (0)