vg-print-vue2 1.0.211 → 1.0.302

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.en.md CHANGED
@@ -33,6 +33,36 @@ https://download.csdn.net/download/github_38400706/92538739
33
33
  npm i vg-print-vue2
34
34
  ```
35
35
 
36
+ If you need client direct printing (`hiwebSocket`), install the optional dependency in your host app:
37
+
38
+ ```bash
39
+ npm i socket.io-client
40
+ ```
41
+
42
+ In your main entry file (e.g., `main.ts`):
43
+
44
+ ```js
45
+ import { io } from 'socket.io-client'
46
+ import { setSocketIo } from 'vg-print'
47
+
48
+ setSocketIo(io)
49
+ ```
50
+
51
+ If you need the Data Source feature, install the optional dependency in your host app:
52
+
53
+ ```bash
54
+ npm i axios
55
+ ```
56
+
57
+ In your main entry file (e.g., `main.ts`):
58
+
59
+ ```js
60
+ import axios from 'axios'
61
+ import { setHttpClient } from 'vg-print-vue2'
62
+
63
+ setHttpClient(axios)
64
+ ```
65
+
36
66
  ## Header Component
37
67
 
38
68
  - Used for the top area of the page, with built-in common operation buttons and printer settings; supports customization via `props` and `slots`.
package/README.md CHANGED
@@ -91,8 +91,6 @@ hiprint.register({
91
91
 
92
92
  ## 静默打印客户端工具安装包
93
93
 
94
- ![静默打印客户端工具](https://gitee.com/gao111/electron-vg-print/raw/master/electron-hiprint.png)
95
-
96
94
  [客户端工具下载](https://download.csdn.net/download/github_38400706/92538739)
97
95
 
98
96
  ## 特性
@@ -109,6 +107,43 @@ hiprint.register({
109
107
  ```bash
110
108
  npm i vg-print-vue2
111
109
  ```
110
+ ### 可选依赖:直连打印/客户端连接(socket.io-client)
111
+
112
+ - 本库默认不内置 `socket.io-client`,以减少默认安装体积。
113
+ - 仅当你需要“直连打印/客户端连接(webSocket)”能力(如 `print()` / `print2()` / 自动连接)时,才需要安装并注入:
114
+
115
+ ```bash
116
+ npm i socket.io-client
117
+ ```
118
+
119
+ 在项目入口(如 `main.ts`)注入:
120
+
121
+ ```js
122
+ import { io } from 'socket.io-client'
123
+ import { setSocketIo } from 'vg-print'
124
+
125
+ setSocketIo(io)
126
+ ```
127
+
128
+ 也可直接使用 `window.io = io`(等价)。
129
+
130
+ ### 可选依赖:数据源(axios)
131
+
132
+ - 本库默认不内置 `axios`,以减少默认安装体积。
133
+ - 仅当你需要使用“数据源管理/接口测试获取/字段绑定”等能力时,才需要安装并注入:
134
+
135
+ ```bash
136
+ npm i axios
137
+ ```
138
+
139
+ 在项目入口(如 `main.ts`)注入:
140
+
141
+ ```js
142
+ import axios from 'axios'
143
+ import { setHttpClient } from 'vg-print-vue2'
144
+
145
+ setHttpClient(axios)
146
+ ```
112
147
 
113
148
  ## Header 顶部工具栏组件
114
149