vue修改title和图标
<title>这是title</title>
<link rel="icon" type="image/x-icon" href="./static/icon.ico">
-
图片放在static文件夹下即可
-
动态修改title
//main.js
router.beforeEach((to, from, next) => {
window.document.title = to.meta.title == undefined?'默认标题':to.meta.title
});
//路由加上meta属性
{
path: '/dashboard',
component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/Dashboard.vue'),
meta: { title: '系统首页' } //路由加上meta属性
},