Skip to content

Commit 78f2c46

Browse files
committed
fix: another inline array to const
1 parent 48061ba commit 78f2c46

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/shared/plugin.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ export default function VueMeta(Vue, options = {}) {
4444
// store an id to keep track of DOM updates
4545
let batchID = null
4646

47+
// for which Vue lifecycle hooks should the metaInfo be refreshed
48+
const updateOnLifecycleHook = ['activated', 'deactivated', 'beforeMount']
49+
4750
const triggerUpdate = (vm) => {
4851
// batch potential DOM updates to prevent extraneous re-rendering
4952
batchID = batchUpdate(batchID, () => vm.$meta().refresh())
@@ -77,7 +80,7 @@ export default function VueMeta(Vue, options = {}) {
7780
}
7881
}
7982

80-
['activated', 'deactivated', 'beforeMount'].forEach((lifecycleHook) => {
83+
updateOnLifecycleHook.forEach((lifecycleHook) => {
8184
this.$options[lifecycleHook] = this.$options[lifecycleHook] || []
8285
this.$options[lifecycleHook].push(() => triggerUpdate(this))
8386
})

0 commit comments

Comments
 (0)