src/components/core/AppHeader.vue
@@ -9,7 +9,8 @@ </el-space> </el-col> <el-col :span="12" class="logout"> <el-button icon="SwitchButton">退出登录</el-button> <FYBgTaskDialog></FYBgTaskDialog> <el-button icon="SwitchButton" @click="logout">退出登录</el-button> </el-col> </el-row> </template> @@ -49,6 +50,12 @@ this.isCollapsed = !this.isCollapsed this.$emit('collapsedSider', this.isCollapsed) }, /** * 退出登录 */ logout() { this.$router.push(`/login`); }, }, } </script>