在範本中, $event.target 的型別只是 EventTarget 。在 getValue() 方法中,把此目標轉為 HTMLInputElement 型別,以允許對其 value 屬性進行型別安全的訪問。
確定! 回上一頁