Skip to content

Commit

Permalink
fix: 修复IDE快捷键监听未销毁的问题;
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow committed Aug 6, 2021
1 parent b3ea99f commit cacb1c0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/devops-admin/src/views/development/function.vue
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,20 @@ export default {
this.getLatestLogs()
this.setTagViewTitle()
},
mounted() {
document.removeEventListener('keydown', this.bindShortKey, false)
document.addEventListener('keydown', this.bindShortKey, false)
},
activated() {
document.removeEventListener('keydown', this.bindShortKey, false)
document.addEventListener('keydown', this.bindShortKey, false)
},
deactivated() {
document.removeEventListener('keydown', this.bindShortKey, false)
},
beforeDestroy() {
document.removeEventListener('keydown', this.bindShortKey, false)
},
methods: {
/**
* 获取函数数据
Expand Down Expand Up @@ -241,7 +249,7 @@ export default {
if (showTip) {
await this.getFunction()
await this.addFunctionHistory()
this.$message.success('已保存')
this.$message.success('已保存: ' + this.func.name)
}
this.loading = false
Expand Down

0 comments on commit cacb1c0

Please sign in to comment.