vue設置ioc圖標和title
1.ioc圖標設置
在根目錄中的index.html中引入代碼:
<link rel="shortcut icon" type="image/x-icon" href="./favicon.ico" rel="external nofollow" />
2.title設置
首先在根目錄中的index.html中加入代碼:
<title>標題</title>
這樣每個頁面的標題都相同,不同頁面的標題定制推薦使用 vue-wechat-title插件
1.安裝插件
npm install vue-wechat-title
2. 在 main.js 中加入
import VueWechatTitle from 'vue-wechat-title'; Vue.use(VueWechatTitle)
3. 路由中加下 title
{
path: '/Login',
/* * 按需加載 */
component: (resolve) => {
require(['@/components/Login.vue'], resolve)
},
meta: {
title: '登錄'
}
}
}
4. 在app.vue 中修改 router-view ,加入他的這個組件
<router-view v-wechat-title="$route.meta.title"></router-view>
正常的話,你再訪問就能看到自己寫的標題了
參考自:https://www.cnblogs.com/jshare/p/7421670.html
