vg-print 1.0.335 → 1.0.336

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  您可以直接安装引入体验功能.
6
6
  没有域名限制,无网可用. 提供一对一技术支持.
7
7
  npm搜索vg-print.
8
- 联系我加 QQ: 984239686 或使用首页有微信号加入
8
+ 授权或购买源码: 联系我加 QQ: 984239686
9
9
 
10
10
 
11
11
 
@@ -198,47 +198,28 @@ tpl.toImage({ name: '示例' }, { isDownload: true, name: '图片', limit: 1, ty
198
198
  - 运行态(预览、浏览器打印、导出 PDF/图片、直连打印):
199
199
  - 无授权(未注册 `authKey`):
200
200
  - 面板未填写内容 → 显示默认水印 `{ content: 'vg-print', timestamp: true }`
201
- - 面板填写了内容 → 显示面板内容 + "试用版" 后缀
202
- - 有授权(已注册有效 `authKey`):
203
- - 面板未填写内容 不显示水印(默认水印被移除)
204
- - 面板填写了内容 → 显示面板内容(无后缀)
205
-
206
- - 生成授权密钥:
207
- 你需要使用特定的字符串(如 `gmc5760337`)生成 Base64 编码的密钥对象。
208
-
209
- ```js
210
- // 简易生成脚本 (Node.js 或浏览器控制台)
211
- function generateKey(k) {
212
- const json = JSON.stringify({ k: String(k) });
213
- return typeof btoa === 'function' ? btoa(json) : Buffer.from(json).toString('base64');
214
- }
215
-
216
- // 生成 Key
217
- const myKey = generateKey('gmc5760337');
218
- // 输出: eyJrIjoiZ21jNTc2MDMzNyJ9
219
- ```
201
+ - 面板填写了内容 → 显示“用户内容 + 试用版”并带时间戳;默认水印不再显示
202
+ - 有授权(注册有效 `authKey`):不显示默认水印;面板填写什么就显示什么,未填写则不显示
203
+ - 适用于所有入口:完整设计器组件、直接 `new hiprint.PrintTemplate(...)`、以及轻量运行时 API(`createTemplate`)。
220
204
 
221
- - 注册授权密钥:
222
- 在项目入口(如 `main.js` 或 `App.vue`)尽早注册:
205
+ - 全局注册授权密钥:
223
206
 
224
- ```js
225
- import { hiprint } from 'vg-print';
207
+ ```js
208
+ import { hiprint } from 'vg-print'
226
209
 
227
- // 填入生成的 Key
228
- hiprint.register({ authKey: 'eyJrIjoiZ21jNTc2MDMzNyJ9' });
229
- ```
210
+ // 注册授权 key(建议在应用启动时调用)
211
+ hiprint.register({ authKey: '你的key' })
230
212
 
231
- 注册后,以下所有使用方式均会自动生效(移除默认水印):
232
- - 完整设计器组件 `FullDesigner`
233
- - 核心类 `new hiprint.PrintTemplate(...)`
234
- - 轻量运行时 helper `createTemplate(...)`
213
+ // 有授权 key → 运行态默认水印移除(设计态由面板设置项决定)
214
+ const tpl = new hiprint.PrintTemplate({ template: {} })
215
+ ```
235
216
 
236
- - 示例:轻量运行时使用授权
217
+ - 轻量运行时 API 使用授权:
237
218
 
238
219
  ```js
239
220
  import { hiprint, createTemplate, printBrowser } from 'vg-print'
240
221
 
241
- hiprint.register({ authKey: 'eyJrIjoiZ21jNTc2MDMzNyJ9' })
222
+ hiprint.register({ authKey: 'YOUR_AUTH_KEY' })
242
223
  const tpl = createTemplate(tmplJson) // 不再自动注入默认水印
243
224
  printBrowser(tpl, data)
244
225
  ```