mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-25 06:30:34 +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 inject from '../server/inject'
|
||||||
import { showWarningNotSupported } from '../shared/log'
|
import { showWarningNotSupported } from '../shared/log'
|
||||||
import { addApp } from './additional-app'
|
import { addApp } from './additional-app'
|
||||||
|
import { addNavGuards } from './nav-guards'
|
||||||
import { pause, resume } from './pausing'
|
import { pause, resume } from './pausing'
|
||||||
import { getOptions } from './options'
|
import { getOptions } from './options'
|
||||||
|
|
||||||
@@ -13,6 +14,11 @@ export default function $meta (options = {}) {
|
|||||||
*/
|
*/
|
||||||
return {
|
return {
|
||||||
getOptions: () => getOptions(options),
|
getOptions: () => getOptions(options),
|
||||||
|
setOptions: ({ refreshOnceOnNavigation } = {}) => {
|
||||||
|
if (refreshOnceOnNavigation) {
|
||||||
|
addNavGuards(this)
|
||||||
|
}
|
||||||
|
},
|
||||||
refresh: () => refresh(this, options),
|
refresh: () => refresh(this, options),
|
||||||
inject: () => process.server ? inject(this, options) : showWarningNotSupported(),
|
inject: () => process.server ? inject(this, options) : showWarningNotSupported(),
|
||||||
pause: () => pause(this),
|
pause: () => pause(this),
|
||||||
|
|||||||
Reference in New Issue
Block a user