vue关闭当前标签页

this.$store.dispatch("tagsView/delView", this.$route);

刷新table页面(执行某一方法后需要刷新下tab页面)

const currentView = '/mail/cfg'
this.$store.dispatch('tagsView/delCachedView',currentView).then(() => {
		this.$nextTick(() => {
			this.$router.replace({
				path: '/redirect' + currentView
			})
		})
	})
}

vue关闭当前标签页并返回指定页面/上一步路由

关闭当前标签页并返回指定页面:

// 调用全局挂载的方法,关闭当前页
this.$store.dispatch("tagsView/delView", this.$route)
// 关闭之后跳转你要跳转的路由
this.$router.push({ path: '要跳转的页面路径' })
// 或者
this.$router.push({ name: '要跳转的页面名称' })

关闭当前标签页并返回上一步路由:

 // 调用全局挂载的方法,关闭当前页
 this.$store.dispatch("tagsView/delView", this.$route);
 // 返回上一步路由
 this.$router.go(-1)

原文地址:
vue 关闭当前标签页并返回指定页面 / 上一步路由
项目UI记录-01

Logo

前往低代码交流专区

更多推荐