mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-16 11:44:01 +08:00
add dynamic title (#1062)
This commit is contained in:
@@ -9,6 +9,7 @@ import MainFooter from './components/footer.vue';
|
||||
import MainHeader from './components/header.vue';
|
||||
import SideNav from './components/side-nav';
|
||||
import FooterNav from './components/footer-nav';
|
||||
import title from './i18n/title';
|
||||
|
||||
Vue.use(Element);
|
||||
Vue.use(VueRouter);
|
||||
@@ -24,6 +25,10 @@ const router = new VueRouter({
|
||||
routes
|
||||
});
|
||||
|
||||
router.afterEach(route => {
|
||||
document.title = title[route.meta.lang][route.name] || 'Element';
|
||||
});
|
||||
|
||||
new Vue({ // eslint-disable-line
|
||||
render: h => h(entry),
|
||||
router
|
||||
|
||||
Reference in New Issue
Block a user