Skip to content

Commit

Permalink
deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
hooray committed Sep 4, 2024
1 parent 74f55a4 commit 3aa4dab
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ _hmt.push(['_requirePlugin', 'UrlChangeTracker', {
{ text: '标准模块', link: '/guide/plop-module' },
{ text: '常用 API', link: '/guide/api' },
{ text: '私有 Storage 数据', link: '/guide/storage' },
{ text: '首屏 Loading', link: '/guide/loading' },
{ text: '页面水印', link: '/guide/watermark' },
{ text: '错误日志', link: '/guide/error-log' },
{ text: '自定义字体', link: '/guide/font' },
Expand Down
13 changes: 13 additions & 0 deletions guide/loading.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 首屏 Loading

首屏 Loading 是指首次访问页面,在页面上空白的等待时间时,会展示一个 Loading 动画,直到页面加载完成。

![](/loading.png){data-zoomable}

## 自定义

直接修改根目录下的 `/loading.html` 文件即可,你可以从 [CSS Loaders](https://css-loaders.com/) 网站中找找灵感,它提供了 600+ 个纯 CSS 的加载动画。

## 原理

框架会自动读取 `/loading.html` 文件内容并在 Vite 构建前注入到 `/index.html` 中,所以它也支持 Vite 的 [HTML 环境变量替换](https://cn.vitejs.dev/guide/env-and-mode.html#html-env-replacement)
Binary file added public/loading.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3aa4dab

Please sign in to comment.