2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-12 19:12:27 +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
+11 -3
View File
@@ -7,18 +7,26 @@ Vue.use(VueMeta, {
refreshOnceOnNavigation: true
})
let metaUpdated = 'no'
const ChildComponent = {
name: `child-component`,
props: ['page'],
template: `<h3>You're looking at the <strong>{{ page }}</strong> page</h3>`,
template: `<div>
<h3>You're looking at the <strong>{{ page }}</strong> page</h3>
<p>Has metaInfo been updated? {{ metaUpdated }}</p>
</div>`,
metaInfo () {
return {
title: `${this.page} - ${this.date && this.date.toTimeString()}`
title: `${this.page} - ${this.date && this.date.toTimeString()}`,
afterNavigation() {
metaUpdated = 'yes'
}
}
},
data() {
return {
date: null
date: null,
metaUpdated
};
},
mounted() {