We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f54b389 commit 4afb91eCopy full SHA for 4afb91e
packages/@vuepress/core/lib/client/root-mixins/updateMeta.js
@@ -17,8 +17,14 @@ export default {
17
},
18
// Other life cycles will only be called at client
19
mounted () {
20
- // init currentMetaTags from DOM
21
- this.currentMetaTags = [...document.querySelectorAll('meta')]
+ // init currentMetaTags from pageMeta
+ this.currentMetaTags = this.getMergedMetaTags().map(m => {
22
+ let selector = 'meta'
23
+ for (const [key, value] of Object.entries(m)) {
24
+ selector += `[${key}="${value}"]`
25
+ }
26
+ return [...document.querySelectorAll(selector)]
27
+ }).flat()
28
29
// update title / meta tags
30
this.updateMeta()
0 commit comments