2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-22 11:50:34 +03:00

feat: add option to refresh once during navigation (possible fix for #320)

chore: add es build

chore: global window detection

chore: small refactor improvements
This commit is contained in:
pimlie
2019-02-20 18:35:01 +01:00
parent 087e4abe76
commit 8e211751df
12 changed files with 145 additions and 7 deletions
+6
View File
@@ -64,6 +64,7 @@
- [`__dangerouslyDisableSanitizers` ([String])](#__dangerouslydisablesanitizers-string)
- [`__dangerouslyDisableSanitizersByTagID` ({[String]})](#__dangerouslydisablesanitizersbytagid-string)
- [`changed` (Function)](#changed-function)
- [`refreshOnceOnNavigation` (Boolean)](#refreshonceonnavigation-boolean)
- [How `metaInfo` is Resolved](#how-metainfo-is-resolved)
- [Lists of Tags](#lists-of-tags)
- [Performance](#performance)
@@ -652,6 +653,11 @@ Will be called when the client `metaInfo` updates/changes. Receives the followin
}
```
#### `refreshOnceOnNavigation` (Boolean)
Default `false`. If set to `true` then vue-meta will pause updating `metaInfo` during page navigation with vue-router and only refresh once when navigation has finished. It does this by adding a global beforeEach and afterEach navigation guard on the $router instance.
### How `metaInfo` is Resolved
You can define a `metaInfo` property on any component in the tree. Child components that have `metaInfo` will recursively merge their `metaInfo` into the parent context, overwriting any duplicate properties. To better illustrate, consider this component heirarchy: