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

feat: add afterNavigation callback (fix: #259)

This commit is contained in:
pimlie
2019-03-05 15:11:25 +01:00
parent 173b31d1d7
commit 97badf61cb
6 changed files with 48 additions and 7 deletions
+18
View File
@@ -657,6 +657,24 @@ Will be called when the client `metaInfo` updates/changes. Receives the followin
Default `false`. If set to `true` then vue-meta will pause updating `metaInfo` during page navigation and only refresh once when navigation has finished. It does this by adding a global beforeEach and afterEach navigation guard on the vue-router instance.
#### `afterNavigation` (Function)
Will be called when the client `metaInfo` has changed after navigation occured. Receives the following parameters:
- `newInfo` (Object) - The new state of the `metaInfo` object.
> :warning: This option only works when `refreshOnceOnNavigation: true`. Please see the [vue-router example](./examples/vue-router)
`this` context is the component instance `afterNavigation` is defined on.
```js
{
metaInfo: {
afterNavigation (newInfo) {
console.log('Meta info update finished after navigation!')
}
}
}
```
### How `metaInfo` is Resolved