效果图
第一步
router/index.js里设置标题中添加中文字段
//router/index.js
router.afterEach((to, from) => {
let isTabbarData = checkIsTabbar(to);
if (isTabbarData.isTabbar) {
store.commit('SET_TABBAR_CURRENT', isTabbarData.tabbarName);
}
checkPageStack(to, from);
// 设置标题
document.title = to.query.title || to.meta.title|| '广州颐生妇儿综合门诊';
});
第二步
public/index.html中将title标签里添加中文字段
//public/index.html
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta
content="width=device-width,initial-scale=1.0,user-scalable=no,viewport-fit=cover"
name="viewport"
/>
<!-- <meta name="referrer" content="no-referrer"> -->
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<!--修改title里的字段-->
<title>广州颐生妇儿综合门诊</title>
</body>
</html>