File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
packages/@vuepress/client/src/injections Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1
1
import { onMounted , ref , useSSRContext , watch } from 'vue'
2
+ import { useRoute } from 'vue-router'
2
3
import { isPlainObject , isString } from '@vuepress/shared'
3
4
import type { HeadConfig , VuepressSSRContext } from '@vuepress/shared'
4
5
import { usePageHead } from './pageHead'
@@ -70,6 +71,7 @@ export const createHeadTag = ([
70
71
* This composable function should be used only once in the root app
71
72
*/
72
73
export const useUpdateHead = ( ) : void => {
74
+ const route = useRoute ( )
73
75
const head = usePageHead ( )
74
76
const lang = usePageLang ( )
75
77
@@ -118,6 +120,9 @@ export const useUpdateHead = (): void => {
118
120
onMounted ( ( ) => {
119
121
loadHead ( )
120
122
updateHead ( )
121
- watch ( [ head , lang ] , ( ) => updateHead ( ) )
123
+ watch (
124
+ ( ) => route . path ,
125
+ ( ) => updateHead ( )
126
+ )
122
127
} )
123
128
}
You can’t perform that action at this time.
0 commit comments