3
に入力値を渡します。エルムHtml.Events - 私は入力のこの種を持っているonBlurイベントメッセージ
inputName player =
input
[ type_ "text"
, onInput (Msgs.ChangeName player)
, value player
]
すべての1文字をMsgs.ChangeNameを作成し、入力に加えます。
私は、ユーザーが入力を離れた後のモデルを更新することを好むだろうが、入力についてのペイロードをonBlur持っていない:上記のコード
inputName player =
input
[ type_ "text"
, onBlur (Msgs.ChangeName player)
, value player
]
はエラーで終わるコンパイルされません:
The 1st entry has this type:
Html (String -> Msg)
But the 2nd is:
Html (Msg)
Hint: It looks like a function needs 1 more argument.