iview-project 改写页面 title
iview-project默认引入Util插件改写页面的title(main.js)
import Util from './libs/util';
但是Util默认在页面title后面增加“ - Home”的字样,如:
改成自己的,要改成:
Util.title = function(title) { title = title ? title + ' - 总裁助手文档' : '总裁助手文档'; window.document.title = title; }; router.beforeEach((to, from, next) => { iView.LoadingBar.start(); Util.title(to.meta.title); next(); }); router.afterEach((to, from, next) => { iView.LoadingBar.finish(); window.scrollTo(0, 0); });
改写后就变成了