Browse Source

docs: update global loading plugin references (#8331)

pull/8334/head
俞可 · YU KE 4 weeks ago
committed by GitHub
parent
commit
8d697d2378
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      docs/src/en/guide/in-depth/loading.md
  2. 4
      docs/src/guide/in-depth/loading.md

4
docs/src/en/guide/in-depth/loading.md

@ -6,7 +6,7 @@ Global loading refers to the loading effect that appears when the page is refres
## Principle
Implemented by the `vite-plugin-inject-app-loading` plugin, the plugin injects a global `loading html` into each application.
The built-in `inject-app-loading` plugin implements this behavior. Its source is in `internal/vite-config/src/plugins/inject-app-loading`, and it injects global loading HTML into each application.
## Disable
@ -20,6 +20,8 @@ VITE_INJECT_APP_LOADING=false
If you want to customize the global loading, you can create a `loading.html` file in the application directory, at the same level as `index.html`. The plugin will automatically read and inject this HTML. You can define the style and animation of this HTML as you wish.
The built-in default template is available at `internal/vite-config/src/plugins/inject-app-loading/default-loading.html` for reference.
::: tip
- You can use the same syntax as in `index.html`, such as the `VITE_APP_TITLE` variable, to get the application's title.

4
docs/src/guide/in-depth/loading.md

@ -6,7 +6,7 @@
## 原理
由 `vite-plugin-inject-app-loading` 插件实现,插件会在每个应用都注入一个全局的 `loading html`。
由项目内置的 `inject-app-loading` 插件实现。源码位于 `internal/vite-config/src/plugins/inject-app-loading`,插件会在每个应用中注入全局 `loading HTML`。
## 关闭
@ -20,6 +20,8 @@ VITE_INJECT_APP_LOADING=false
如果你想要自定义全局 loading,可以在应用目录下,与`index.html`同级,创建一个`loading.html`文件,插件会自动读取并注入。这个html可以自行定义样式和动画。
项目内置的默认模板位于 `internal/vite-config/src/plugins/inject-app-loading/default-loading.html`,可作为自定义参考。
::: tip
- 你可以使用跟`index.html`一样的语法,比如`VITE_APP_TITLE`变量,来获取应用的标题。

Loading…
Cancel
Save