//store/modules/tagsView.js页面中添加
const mutations = {
//动态改变tab 页签
	EDIT_VISITED_VIEWS: (state, view) => {
		for (var Index in state.visitedViews) {        
			console.log(state.visitedViews[Index].path)        
			if (state.visitedViews[Index].path == view.path) {       
				state.visitedViews[Index].title = view.meta.title        
			}        
		}        
	}, 
}


const actions = {
 //动态改变tab 页签(上方还有代码) 调用debug/debugData/calibrationRecord.vue
	// this.$route.meta.title = reportName    
	// this.$store.dispatch('tagsView/editVisitedViews', this.$route)
	editVisitedViews({ commit, state }, view) {
		return new Promise((resolve) => {
			commit('EDIT_VISITED_VIEWS', view)
			resolve([...state.visitedViews])
		})
	},
}




//页面中调用
 this.$route.meta.title = '随机名字'
 this.$store.dispatch('tagsView/editVisitedViews', this.$route)
Logo

快速构建 Web 应用程序

更多推荐