vue中注册快捷键esc关闭弹窗

window.addEventListener('keydown', (e) => {

      if (e.keyCode == 27) {

        this.popShow = false

      }

})