无论页面是否刷新,本地服务器上的断点只会被触发一次。
main =
Navigation.program UrlChange
{ init = init
, view = view
, update = update
, subscriptions = (\_ -> Sub.none)
}
init : Navigation.Location -> ( Model, Cmd Msg )
init location =
( { currentRoute = location
, ...
}
, runtime.bootstrap BootstrapResponse
)
“浏览历史记录”窗口报告在页面刷新后只生成了一条消息:
BootstrapResponse Ok
问题:
刷新目标网页后,为什么我的引导请求没有发送到服务器?
附录
bootstrap : (Result Http.Error JsonBootstrap -> msg) -> Cmd msg
bootstrap msg =
let
url =
baseUrl ++ "bootstrap"
request =
Http.get url bootstrapDecoder
in
Http.send msg request
更新
我在Chrome和Edge上测试了这个。