This repository was archived by the owner on Oct 1, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,10 @@ export default function VueMeta (Vue, options = {}) {
38
38
// watch for client side component updates
39
39
Vue . mixin ( {
40
40
beforeCreate ( ) {
41
+ // Add a marker to know if it uses metaInfo
42
+ if ( typeof this . $options [ options . keyName ] !== 'undefined' ) {
43
+ this . _hasMetaInfo = true
44
+ }
41
45
// coerce function-style metaInfo to a computed prop so we can observe
42
46
// it on creation
43
47
if ( typeof this . $options [ options . keyName ] === 'function' ) {
@@ -60,15 +64,15 @@ export default function VueMeta (Vue, options = {}) {
60
64
} ,
61
65
beforeMount ( ) {
62
66
// batch potential DOM updates to prevent extraneous re-rendering
63
- if ( this . $metaInfo ) {
67
+ if ( this . _hasMetaInfo ) {
64
68
batchID = batchUpdate ( batchID , ( ) => this . $meta ( ) . refresh ( ) )
65
69
}
66
70
} ,
67
71
destroyed ( ) {
68
72
// do not trigger refresh on the server side
69
73
if ( this . $isServer ) return
70
74
// re-render meta data when returning from a child component to parent
71
- if ( this . $metaInfo ) {
75
+ if ( this . _hasMetaInfo ) {
72
76
batchID = batchUpdate ( batchID , ( ) => this . $meta ( ) . refresh ( ) )
73
77
}
74
78
}
You can’t perform that action at this time.
0 commit comments