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:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user