Closed francoism90 closed 6 years ago
For the record: You could use Headful with vue-router as follows:
// router configuration
// ...
{
path: '/',
// ...
meta: {
title: 'Title',
description: 'Description',
}
}
// ...
import headful from 'headful';
router.beforeEach((to, from, next) => {
headful(to.meta);
next();
});
In that scenario, there is no need for vue-headful but only Headful.
@troxler And up with this:
router.beforeEach((to, from, next) => {
const meta = _.pick(to.meta, ['title', 'description']);
headful(meta);
next();
});
Thanks, this is really helpful. :)
I'm using vuex now. :)