vue 保存组合键(ctrl + s)
mounted() { window.addEventListener('keydown', this.saveContent) }, beforeDestroy() { window.removeEventListener('keydown', this.saveContent) }, methods: { saveContent(e) { const key = window.event.keyCode ? window.event.keyCode : window.event.which if (key === 83 && e.ctrlKey) { this.onSave() e.preventDefault() } } }