miracle/middleware/title.js
2020-02-02 03:26:13 +07:00

7 lines
234 B
JavaScript

export default ({ route, store }) => {
// Take the last value (latest route child)
console.log(route.meta);
const title = route.meta.reduce((title, meta) => meta.title || title, 'Damillora')
store.commit('SET_TITLE', title)
}