update 优化窗口右键菜单
This commit is contained in:
@@ -23,8 +23,16 @@
|
|||||||
<a-menu-item @click="onLoadContentWindow(pane.key)" key="0">重新加载</a-menu-item>
|
<a-menu-item @click="onLoadContentWindow(pane.key)" key="0">重新加载</a-menu-item>
|
||||||
<a-menu-divider />
|
<a-menu-divider />
|
||||||
<a-menu-item :disabled="!pane.closable" @click="$emit('close', pane.key);" key="1">关闭</a-menu-item>
|
<a-menu-item :disabled="!pane.closable" @click="$emit('close', pane.key);" key="1">关闭</a-menu-item>
|
||||||
<a-menu-item @click="$emit('close-other', pane.key)" key="2">关闭其他标签页</a-menu-item>
|
<a-menu-item
|
||||||
<a-menu-item @click="$emit('close-right', pane.key)" key="3">关闭右侧标签页</a-menu-item>
|
:disabled="!hasOther(pane)"
|
||||||
|
@click="$emit('close-other', pane.key)"
|
||||||
|
key="2"
|
||||||
|
>关闭其他标签页</a-menu-item>
|
||||||
|
<a-menu-item
|
||||||
|
:disabled="!hasRight(pane)"
|
||||||
|
@click="$emit('close-right', pane.key)"
|
||||||
|
key="3"
|
||||||
|
>关闭右侧标签页</a-menu-item>
|
||||||
</a-menu>
|
</a-menu>
|
||||||
</a-dropdown>
|
</a-dropdown>
|
||||||
<component :is="pane.component" :key="pane.key" v-if="pane.loaded" />
|
<component :is="pane.component" :key="pane.key" v-if="pane.loaded" />
|
||||||
@@ -103,6 +111,14 @@ export default {
|
|||||||
this.$message.error('复制错误');
|
this.$message.error('复制错误');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
hasOther(pane) {
|
||||||
|
return this.panes.filter((p) => p.key !== pane.key && p.closable).length > 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
hasRight(pane) {
|
||||||
|
return this.panes.length > this.panes.indexOf(pane) + 1;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
Reference in New Issue
Block a user