在 router.beforeEach((to, from, next) => {}
裏面vue
const browserHeaderTitle = to.name
SET_BROWSERHEADERTITLE: (state, action) => { state.browserHeaderTitle = action.browserHeaderTitle } store.commit('SET_BROWSERHEADERTITLE', { browserHeaderTitle: browserHeaderTitle })
咱們在路由after後設置titlegit
/** * 設置瀏覽器頭部標題 */ export const setTitle = function(title) { title = title ? `${title}` : 'NxAdmin' window.document.title = title } router.afterEach(() => { NProgress.done() // 結束Progress setTimeout(() => { const browserHeaderTitle = store.getters.browserHeaderTitle setTitle(browserHeaderTitle) }, 0) })
基於Vue2.0實現後臺系統權限控制github
前端文檔彙總vuex
VUE2.0增刪改查附編輯添加model(彈框)組件共用瀏覽器