vuejs: @keyup.esc on div element is not working

前端 未结 6 1900
轻奢々
轻奢々 2021-02-12 13:10

I\'m expecting that \'close\' event is fired when I\'m clicking ESC button being on \"shadow-modal\" div, but it\'s not happening

vue 2.5.13, any ideas why?

6条回答
  •  时光说笑
    2021-02-12 13:33

    The Key events cannot be generated from div or other elements. In order to get key events from div you need to use inside the div element.

提交回复
热议问题