Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个输入字段
[:input {:type "text"}]
我需要检测用户在编辑该字段时何时按下 Esc 键。我怎么做?
向元素添加:on-key-up(或)处理程序::on-key-down
:on-key-up
:on-key-down
[:input {:type "text" :on-key-up #(when (= 27 (.-which %)) (do-something-here))}]