diff --git a/frontend/src/views/panel/list/PanelMain.vue b/frontend/src/views/panel/list/PanelMain.vue index e7b593d561..d04d24deb1 100644 --- a/frontend/src/views/panel/list/PanelMain.vue +++ b/frontend/src/views/panel/list/PanelMain.vue @@ -77,6 +77,11 @@ export default { if (newVal === 'PanelMain' && this.lastActiveNodeData) { this.activeNodeAndClickOnly(this.lastActiveNodeData) } + }, + activeName: function(newVal, oldVal) { + if (newVal !== 'PanelMain') { + this.clear() + } } }, mounted() { @@ -93,6 +98,15 @@ export default { // this.clear() }, methods: { + clear() { + // 清空 + this.$store.dispatch('panel/setPanelInfo', { + id: null, + name: '', + preStyle: null + }) + this.$store.dispatch('panel/setMainActiveName', 'PanelMain') + }, handleClick(tab, event) { // 点击分析面板需要刷新分享内容 if (tab.name === 'panels_share') {