Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The checkbox input should know if it is checked#736

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Gregoirevda wants to merge1 commit intoelm:master
base:master
Choose a base branch
Loading
fromGregoirevda:patch-1
Open
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
The checkbox input should know if it is checked
  • Loading branch information
@Gregoirevda
Gregoirevda authoredAug 25, 2017
commit29427c4611a1e96e323809b8b170527e9aec2f86
14 changes: 7 additions & 7 deletionssrc/examples/checkboxes.elm
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
import Html exposing (Html, beginnerProgram, fieldset, input, label, text)
import Html.Attributes exposing (style, type_)
import Html.Attributes exposing (style, type_, checked)
import Html.Events exposing (onClick)


Expand DownExpand Up@@ -54,17 +54,17 @@ update msg model =
view : Model -> Html Msg
view model =
fieldset []
[ checkbox ToggleNotifications "Email Notifications"
, checkbox ToggleAutoplay "Video Autoplay"
, checkbox ToggleLocation "Use Location"
[ checkboxmodel.notificationsToggleNotifications "Email Notifications"
, checkboxmodel.autoplayToggleAutoplay "Video Autoplay"
, checkboxmodel.locationToggleLocation "Use Location"
]


checkbox : msg -> String -> Html msg
checkbox msg name =
checkbox :isChecked ->msg -> String -> Html msg
checkboxisCheckedmsg name =
label
[ style [("padding", "20px")]
]
[ input [ type_ "checkbox", onClick msg ] []
[ input [ type_ "checkbox", onClick msg, checked isChecked ] []
, text name
]

[8]ページ先頭

©2009-2025 Movatter.jp