模块“Html”不公开“beginnerProgram”
Module `Html` does not expose `beginnerProgram`
我正在尝试 import Html exposing (beginnerProgram)
,如图所示 there and there,但编译器不同意:"Module Html
does not expose beginnerProgram
".
提前致谢。
通过从 Html.App
而不是 Html
导入解决。
以上答案适用于旧版本的 ELM。更新后的答案如下。
更新为 Elm 0.19:
添加导入语句:
import Browser exposing (sandbox)
使用沙盒: 请注意,我们 不是 使用 Never
- 与旧代码示例一样 - 我们使用 ()
改为:
main : Program () Model Msg
main = Browser.sandbox
{ init = initialModel
, view = view
, update = update
}
效果很好:希望对您有所帮助。
我正在尝试 import Html exposing (beginnerProgram)
,如图所示 there and there,但编译器不同意:"Module Html
does not expose beginnerProgram
".
提前致谢。
通过从 Html.App
而不是 Html
导入解决。
以上答案适用于旧版本的 ELM。更新后的答案如下。
更新为 Elm 0.19:
添加导入语句:
import Browser exposing (sandbox)
使用沙盒: 请注意,我们 不是 使用 Never
- 与旧代码示例一样 - 我们使用 ()
改为:
main : Program () Model Msg
main = Browser.sandbox
{ init = initialModel
, view = view
, update = update
}
效果很好:希望对您有所帮助。