2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-18 00:10:33 +03:00

feat: enable setting refreshOnceOnNavigation during runtime

This commit is contained in:
pimlie
2019-09-13 13:41:26 +02:00
committed by Pim
parent b73b8ede03
commit 9d14387cda
+6
View File
@@ -2,6 +2,7 @@ import refresh from '../client/refresh'
import inject from '../server/inject'
import { showWarningNotSupported } from '../shared/log'
import { addApp } from './additional-app'
import { addNavGuards } from './nav-guards'
import { pause, resume } from './pausing'
import { getOptions } from './options'
@@ -13,6 +14,11 @@ export default function $meta (options = {}) {
*/
return {
getOptions: () => getOptions(options),
setOptions: ({ refreshOnceOnNavigation } = {}) => {
if (refreshOnceOnNavigation) {
addNavGuards(this)
}
},
refresh: () => refresh(this, options),
inject: () => process.server ? inject(this, options) : showWarningNotSupported(),
pause: () => pause(this),