mirror of
https://gitee.com/tawords/tawords-docs
synced 2025-01-10 19:38:14 +08:00
drawio viewer.js按需加载&延时加载,保证页面加载速度
This commit is contained in:
parent
6793ff7a27
commit
2ef1a5f52b
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
<!-- 背Ta单词 简介 -->
|
<!-- 背Ta单词 简介 -->
|
||||||
[plugin-structures](include/intro.md ':include')
|
[intro](include/intro.md ':include')
|
||||||
|
|
||||||
## 传送门
|
## 传送门
|
||||||
|
|
||||||
|
12
docs/include/import-drawio-viewer-script.md
Normal file
12
docs/include/import-drawio-viewer-script.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<script>
|
||||||
|
// 加载较慢,延时加载
|
||||||
|
setTimeout(function(){
|
||||||
|
var drawioViewerScript = document.createElement("script");
|
||||||
|
drawioViewerScript.src = "static/docsify/lib/plugins/docsify-drawio/viewer.min.js";
|
||||||
|
document.body.appendChild( drawioViewerScript );
|
||||||
|
}, 10)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- include/import-drawio-viewer-script.md -->
|
||||||
|
|
@ -48,6 +48,9 @@
|
|||||||
// 启用相对路径
|
// 启用相对路径
|
||||||
// relativePath: true,
|
// relativePath: true,
|
||||||
|
|
||||||
|
// 执行文档里的 script 标签里的脚本,只执行第一个 script
|
||||||
|
executeScript: true,
|
||||||
|
|
||||||
// 小屏设备下合并导航栏到侧边栏。
|
// 小屏设备下合并导航栏到侧边栏。
|
||||||
mergeNavbar: true,
|
mergeNavbar: true,
|
||||||
|
|
||||||
@ -195,12 +198,11 @@
|
|||||||
<script src="static/docsify/lib/plugins/docsify-pagination@2.6.1/docsify-pagination.min.js"></script>
|
<script src="static/docsify/lib/plugins/docsify-pagination@2.6.1/docsify-pagination.min.js"></script>
|
||||||
|
|
||||||
<!-- drawio -->
|
<!-- drawio -->
|
||||||
<!-- <script src="https://cdn.jsdelivr.net/npm/docsify-drawio/viewer.min.js"></script> -->
|
<!-- <script src="https://cdn.jsdelivr.net/npm/docsify-drawio/viewer.min.js"></script>
|
||||||
<script src="static/docsify/lib/plugins/docsify-drawio/viewer.min.js"></script>
|
<script src='https://cdn.jsdelivr.net/npm/docsify-drawio/drawio.js'></script> -->
|
||||||
<!-- <script src='https://cdn.jsdelivr.net/npm/docsify-drawio/drawio.js'></script> -->
|
<!-- <script src="static/docsify/lib/plugins/docsify-drawio/viewer.min.js"></script> -->
|
||||||
<script src='static/docsify/lib/plugins/docsify-drawio/drawio.js'></script>
|
<script src='static/docsify/lib/plugins/docsify-drawio/drawio.js'></script>
|
||||||
|
|
||||||
|
|
||||||
<!-- docsify-tabs (latest v1.x.x) -->
|
<!-- docsify-tabs (latest v1.x.x) -->
|
||||||
<!-- https://jhildenbiddle.github.io/docsify-tabs/#/ -->
|
<!-- https://jhildenbiddle.github.io/docsify-tabs/#/ -->
|
||||||
<!-- <script src="https://cdn.jsdelivr.net/npm/docsify-tabs@1"></script> -->
|
<!-- <script src="https://cdn.jsdelivr.net/npm/docsify-tabs@1"></script> -->
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
# drawio
|
# drawio
|
||||||
|
|
||||||
[filename](https://cdn.jsdelivr.net/npm/docsify-drawio/test.drawio ':include :type=code')
|
<!-- 引入drawio viewer.js -->
|
||||||
|
[intro](../include/import-drawio-viewer-script.md ':include')
|
||||||
|
|
||||||
|
[测试](https://cdn.jsdelivr.net/npm/docsify-drawio/test.drawio ':include :type=code')
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
# 深色背景 <!-- 深色背景 -->
|
# 深色背景 <!-- 深色背景 -->
|
||||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/themes/dark.css" />
|
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/themes/dark.css" />
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user