File tree Expand file tree Collapse file tree 2 files changed +23
-13
lines changed
Expand file tree Collapse file tree 2 files changed +23
-13
lines changed Original file line number Diff line number Diff line change 1+ { { flutter_js } }
2+ { { flutter_build_config } }
3+
4+ const loading = document . createElement ( 'div' ) ;
5+ document . body . appendChild ( loading ) ;
6+ loading . textContent = "正在加载中(Step 1)...\n若长时间无响应请尝试更换网络" ;
7+ _flutter . loader . load ( {
8+ config : {
9+ 'canvasKitBaseUrl' : '/canvaskit/' ,
10+ } ,
11+ serviceWorkerSettings : {
12+ serviceWorkerVersion : { { flutter_service_worker_version} } ,
13+ } ,
14+ onEntrypointLoaded : async function ( engineInitializer ) {
15+ loading . textContent = "正在加载中(Step 2)...长时间无响应请尝试删除缓存或更换浏览器" ;
16+ const appRunner = await engineInitializer . initializeEngine ( {
17+ 'fontFallbackBaseUrl' : 'https://fonts.gstatic.cn/s/' ,
18+ } ) ;
19+
20+ loading . textContent = "加载完成正在进入..." ;
21+ await appRunner . runApp ( ) ;
22+ } ,
23+ } ) ;
Original file line number Diff line number Diff line change 11<!DOCTYPE html>
22< html >
33< head >
4- <!--
5- If you are serving your web app in a path other than the root, change the
6- href value below to reflect the base path you are serving from.
7-
8- The path provided below has to start and end with a slash "/" in order for
9- it to work correctly.
10-
11- For more details:
12- * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
13-
14- This is a placeholder for base href that will be replaced by the value of
15- the `--base-href` argument provided to `flutter build`.
16- -->
174 < base href ="$FLUTTER_BASE_HREF ">
185
196 < meta charset ="UTF-8 ">
You can’t perform that action at this time.
0 commit comments