File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,9 @@ export default function VueMeta(Vue, options = {}) {
44
44
// store an id to keep track of DOM updates
45
45
let batchID = null
46
46
47
+ // for which Vue lifecycle hooks should the metaInfo be refreshed
48
+ const updateOnLifecycleHook = [ 'activated' , 'deactivated' , 'beforeMount' ]
49
+
47
50
const triggerUpdate = ( vm ) => {
48
51
// batch potential DOM updates to prevent extraneous re-rendering
49
52
batchID = batchUpdate ( batchID , ( ) => vm . $meta ( ) . refresh ( ) )
@@ -77,7 +80,7 @@ export default function VueMeta(Vue, options = {}) {
77
80
}
78
81
}
79
82
80
- [ 'activated' , 'deactivated' , 'beforeMount' ] . forEach ( ( lifecycleHook ) => {
83
+ updateOnLifecycleHook . forEach ( ( lifecycleHook ) => {
81
84
this . $options [ lifecycleHook ] = this . $options [ lifecycleHook ] || [ ]
82
85
this . $options [ lifecycleHook ] . push ( ( ) => triggerUpdate ( this ) )
83
86
} )
You can’t perform that action at this time.
0 commit comments