我意识到我一定在某个地方缺少一个论点,或者我的一个论点是不正确的,但是在尝试了所有我能想到的东西之后,我不确定该怎么做。
handleKeyDown : msg -> Attribute (Int -> Msg)
handleKeyDown message =
custom "keydown" (Json.succeed { message = KeyPressed, stopPropagation = True, preventDefault = True })
view : Model -> Html Msg
view model =
div []
[ input
[ handleKeyDown ]
[ text "" ]
]
Run Code Online (Sandbox Code Playgroud)
错误
The 1st argument to `input` is not what I expect:
104| [ input
105|> [ handleKeyDown ]
106| [ text "" ]
This argument is a list of type:
List #(msg -> …Run Code Online (Sandbox Code Playgroud)