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

implement fix for #9 edge-case

This commit is contained in:
Declan de Wet
2016-11-08 03:55:55 +02:00
parent ebb101d8e7
commit 6ad56ec73e
7 changed files with 38 additions and 45 deletions
+6 -3
View File
@@ -5,7 +5,7 @@ import Router from 'vue-router'
Vue.use(Router)
Vue.use(VueMeta)
const ChildComponent = () => ({
const ChildComponent = {
name: `child-component`,
props: ['page'],
template: `<h3>You're looking at the <strong>{{ page }}</strong> page</h3>`,
@@ -14,13 +14,16 @@ const ChildComponent = () => ({
return this.page
}
}
})
}
// this wrapper function is not a requirement for vue-router,
// just a demonstration that render-function style components also work.
// See https://github.com/declandewet/vue-meta/issues/9 for more info.
function view (page) {
return {
name: `section-${page}`,
render (h) {
return h(ChildComponent(), {
return h(ChildComponent, {
props: { page }
})
}