vue
KeyboardEvent in Vue
最近在寫 Vue 的時候遇到輸入法選字以及輸入的時候觸發了 @keyup , @keydown 的事件,造成一些不正常的結果;為了避免還在輸入法選字或者輸入後就會觸發輸入框的 KeyboardEvent 需要多增加一些判斷,後來找到 MDN 的說明: The KeyboardEvent.isComposing read-only property returns a boolean value indicating if the event is fired within a composition session, i.e. after compositionstart and before compositionend. The compositionstart event is fired when a text composition system such