2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-08 15:32:25 +03:00

More reliable strategy for getting deepmost component + addition of refresh() method + example & documentation on asynchronous updates

This commit is contained in:
Declan de Wet
2016-11-09 07:26:38 +02:00
parent fa290273df
commit 076832cbd6
18 changed files with 268 additions and 45 deletions
+18
View File
@@ -0,0 +1,18 @@
import getMetaInfo from '../shared/getMetaInfo'
import updateClientMetaInfo from './updateClientMetaInfo'
/**
* When called, will update the current meta info with new meta info.
* Useful when updating meta info as the result of an asynchronous
* action that resolves after the initial render takes place.
*
* Credit to [Sébastien Chopin](https://github.com/Atinux) for the suggestion
* to implement this method.
*
* @return {Object} - new meta info
*/
export default function refresh () {
const info = getMetaInfo(this.$root)
updateClientMetaInfo(info)
return info
}