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

前端 未结 6 625
借酒劲吻你
借酒劲吻你 2021-02-12 12:57

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:42

    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.

提交回复
热议问题