@wwu-restek/vue-update-title
v1.0.0
Published
vue-router navigation guard, updates page/tab titles based on meta data in router
Downloads
2
Readme
ResTek's Vue Update Title Module
This module exposes a vue-router Navigation Guard that updates the page/tab title dynamically.
Installation
npm i @wwu-restek/vue-update-title
Example:
// in vue router.js
import updateTitle from '@wwu-restek/vue-update-title';
const router = {
routes: [
{
path: '/about',
component: About,
meta: { title: 'About' }
}
]
};
const updateTitleConfig = { appTitle: 'Example App' }
router.beforeEach(updateTitle(updateTitleConfig));
export default router;
// This will display the about page with the tab title: `About | Example App`
More Documentation
More complete documentation is available by generating JSDocs for the module.