加载进度条可配置

This commit is contained in:
liuzhihang 2022-10-16 18:13:24 +08:00
parent 731e1aefb6
commit e6bfe63be0
3 changed files with 33 additions and 21 deletions

View File

@ -136,23 +136,6 @@ spec:
label: 底部相关链接
placeholder: 请填写 metadata name
help: "需要通过开发者模式获取菜单对应的 metadata name"
- group: loading
label: 加载页
formSchema:
- $formkit: radio
name: switch
label: 开关
value: true
options:
- label: 打开
value: true
- label: 关闭
value: false
- $formkit: url
name: img
validation: "url"
label: 加载页图片 URL
placeholder: 请输入图片 url
- group: right_menu
label: 右键菜单
formSchema:
@ -435,4 +418,31 @@ spec:
- value: "xcode.min.css"
label: "xcode.min.css"
- value: "xt256.min.css"
label: "xt256.min.css"
label: "xt256.min.css"
- group: other
label: 其他设置
formSchema:
- $formkit: radio
name: loading_box
label: 开关
value: true
options:
- label: 打开
value: true
- label: 关闭
value: false
- $formkit: url
name: loading_box_img
validation: "url"
label: 加载页图片 URL
placeholder: 请输入图片 url
- $formkit: radio
name: load_progress_bar
label: 页面加载进度条
value: true
help: 了解更多https://codebyzach.github.io/pace/
options:
- label: 开启
value: true
- label: 关闭
value: false

View File

@ -181,7 +181,9 @@
<!-- todo 动态加载条,换成可配置 -->
<script data-pace-options='{ "restartOnRequestAfter":false,"eventLag":false}'
src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/pace/1.2.4/pace.min.js"></script>
src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/pace/1.2.4/pace.min.js"
th:if="${theme.config.other.load_progress_bar}">
</script>
<!-- 复制 -->
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.10/dist/clipboard.min.js"></script>

View File

@ -4,9 +4,9 @@
<!-- loading 页面 -->
<div id="loading-box" onclick="heo.hideLoading()"
th:fragment="loading-box"
th:if="${theme.config.loading.switch} and not ${#strings.isEmpty(theme.config.loading.img)}">
th:if="${theme.config.other.loading_box} and not ${#strings.isEmpty(theme.config.other.loading_box_img)}">
<div class="loading-bg">
<img class="loading-img" th:src="${theme.config.loading.img}">
<img class="loading-img" th:src="${theme.config.other.loading_box_img}">
</div>
</div>