Skip to content

Commit f7cf860

Browse files
authored
Merge pull request #1277 from zhensherlock/dev
Dev
2 parents cad9ba5 + 3c80bb5 commit f7cf860

12 files changed

Lines changed: 1517 additions & 725 deletions

File tree

docs/.vitepress/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export default {
6363
text: 'Extra',
6464
items: [
6565
{ text: 'Internet Explorer', link: '/guide/extra/ie' },
66+
{ text: 'On demand', link: '/guide/extra/on-demand' },
6667
]
6768
}
6869
],

docs/.vitepress/locales/zh-CN.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export default {
4545
text: '扩展',
4646
items: [
4747
{ text: 'Internet Explorer', link: '/zh/guide/extra/ie' },
48+
{ text: '按需加载', link: '/zh/guide/extra/on-demand' },
4849
]
4950
}
5051
],

docs/guide/extra/ie.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { Watermark } from 'watermark-js-plus/ie'
1818
## CDN
1919
```html
2020
<!-- import JavaScript -->
21-
<script src="https://www.unpkg.com/watermark-js-plus@1.6.0/dist/ie/index.iife.min.js"></script>
21+
<script src="https://www.unpkg.com/watermark-js-plus@1.6.1/dist/ie/index.iife.min.js"></script>
2222
```
2323

2424
> We recommend our users to lock version when using CDN. Please refer to [unpkg.com](https://unpkg.com/) for more information.

docs/guide/extra/on-demand.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
layout: doc
3+
---
4+
5+
<el-backtop></el-backtop>
6+
7+
# On Demand
8+
This guide explains how to use the on-demand loading feature in watermark-js-plus to optimize your application's performance by only loading the components you need.
9+
10+
## NPM
11+
12+
When using npm, you can import specific components directly to reduce bundle size
13+
14+
```ts
15+
// Import only the Watermark component
16+
import { Watermark } from 'watermark-js-plus/es'
17+
18+
// Import only the BlindWatermark component
19+
import { BlindWatermark } from 'watermark-js-plus/es'
20+
21+
// Import only the ImageWatermark component
22+
import { ImageWatermark } from 'watermark-js-plus/es'
23+
```
24+
25+
## Benefits
26+
- Reduced Bundle Size : Only load the components you actually use
27+
- Improved Performance : Smaller JavaScript payloads lead to faster page loads
28+
- Better User Experience : Quicker initial rendering and interaction
29+
- Lower Network Usage : Especially beneficial for users on limited data plans
30+
31+
On-demand loading is particularly useful for large applications where you might only need specific watermark functionality in certain parts of your application.

docs/zh/guide/extra/ie.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { Watermark } from 'watermark-js-plus/ie'
1818
## CDN
1919
```html
2020
<!-- import JavaScript -->
21-
<script src="https://www.unpkg.com/watermark-js-plus@1.6.0/dist/ie/index.iife.min.js"></script>
21+
<script src="https://www.unpkg.com/watermark-js-plus@1.6.1/dist/ie/index.iife.min.js"></script>
2222
```
2323

2424
> 我们建议使用 CDN 引入用户在链接地址上锁定版本,以免将来插件升级时受到非兼容性更新的影响。锁定版本的方法请查看 [unpkg.com](https://unpkg.com/)

docs/zh/guide/extra/on-demand.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
layout: doc
3+
---
4+
5+
<el-backtop></el-backtop>
6+
7+
# 按需加载
8+
本指南解释了如何在 watermark-js-plus 中使用按需加载功能,以通过仅加载您需要的组件来优化应用程序性能。
9+
10+
## NPM
11+
12+
使用 npm 时,您可以直接导入特定组件以减小包的大小
13+
14+
```ts
15+
// 仅导入 Watermark 组件
16+
import { Watermark } from 'watermark-js-plus/es'
17+
18+
// 仅导入 BlindWatermark 组件
19+
import { BlindWatermark } from 'watermark-js-plus/es'
20+
21+
// 仅导入 ImageWatermark 组件
22+
import { ImageWatermark } from 'watermark-js-plus/es'
23+
```
24+
25+
## Benefits
26+
- 减小包体积:只加载您实际使用的组件
27+
- 提高性能:更小的 JavaScript 负载导致更快的页面加载
28+
- 更好的用户体验 :更快的初始渲染和交互
29+
- 降低网络使用量 :对于使用有限数据计划的用户特别有益
30+
31+
按需加载对于大型应用程序特别有用,在这些应用程序中,您可能只需要在应用程序的特定部分中使用特定的水印功能。

0 commit comments

Comments
 (0)