O monitoramento do teclado VUE pode ser reutilizado

	mounted (){
    
    
        // 键盘监听
        let _this = this;
        document.onkeydown = function(e) {
    
                
            let key = window.event.keyCode;            
            if (key== 13) {
    
    
               _this.audioOn(!_this.clickShow);
            }
        };
    },

おすすめ

転載: blog.csdn.net/Beatingworldline/article/details/121247521