项目
在 GitHub 查看
elm/html
关于
Use HTML in Elm!
网站与应用开发实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文HTML
Quickly render HTML in Elm.
Examples
The HTML part of an Elm program looks something like this:
import Html exposing (Html, button, div, text)
import Html.Events exposing (onClick)
type Msg = Increment | Decrement
view : Int -> Html Msg
view count =
div []
[ button [ onClick Decrement ] [ text "-" ]
, div [] [ text (String.fromInt count) ]
, button [ onClick Increment ] [ text "+" ]
]
If you call view 42 you get something like this:
<div>
<button>-</button>
<div>42</div>
<button>+</button>
</div>
This snippet comes from a complete example. You can play with it online here and read how it works here.
You can play with a bunch of other examples here.
Learn More
Definitely read through guide.elm-lang.org to understand how this all works! The section on The Elm Architecture is particularly helpful.
Implementation
This library is backed by elm/virtual-dom which handles the dirty details of rendering DOM nodes quickly. You can read some blog posts about it here:
探索相关项目
加载中…