限制 markdown 文件才可以被标记

This commit is contained in:
purocean
2019-08-17 16:22:28 +08:00
parent 583c68d5fa
commit 46c5f6fcae
+8 -3
View File
@@ -83,9 +83,14 @@ export default {
{ id: 'openInTerminal', label: '在终端中打开', onClick: () => this.revealInXterminal() }
]))
} else {
this.$contextMenu.show([
{ id: 'mark', label: this.item.marked ? '取消标记' : '标记文件', onClick: () => this.toggleMark() }
].concat(menu))
// markdown 文件可以被标记
if (this.item.path.endsWith('.md')) {
this.$contextMenu.show([
{ id: 'mark', label: this.item.marked ? '取消标记' : '标记文件', onClick: () => this.toggleMark() }
].concat(menu))
} else {
this.$contextMenu.show(menu)
}
}
},
async toggleMark () {