vue-quokit 0.1.3 → 0.1.5
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 +33 -0
- package/dist/index.cjs +9 -9
- package/dist/index.mjs +2486 -1930
- package/package.json +33 -33
package/README.md
CHANGED
|
@@ -158,6 +158,37 @@ const colsState = useColumns([
|
|
|
158
158
|
| `exportExcel(expandRowHeight?)` | 导出 `.xlsx`,可选撑长模式 |
|
|
159
159
|
| `print(vertical?)` | 打印,可选竖版 |
|
|
160
160
|
|
|
161
|
+
### `<QuokitPreview>`
|
|
162
|
+
|
|
163
|
+
一键弹出预览弹窗,内置导出 Excel / 打印 / 查看 JSON 按钮组。
|
|
164
|
+
|
|
165
|
+
| prop | 类型 | 默认 | 说明 |
|
|
166
|
+
|---|---|---|---|
|
|
167
|
+
| `tpl` | `QuokitTemplateData` | — | **必填**,模板对象 |
|
|
168
|
+
| `data` | `Object` | `{ headerData: {}, rows: [], footerData: {} }` | 数据对象 |
|
|
169
|
+
| `config` | `Object` | 见下 | 控制按钮显示 |
|
|
170
|
+
|
|
171
|
+
**config 字段:**
|
|
172
|
+
|
|
173
|
+
| 字段 | 类型 | 默认 | 说明 |
|
|
174
|
+
|---|---|---|---|
|
|
175
|
+
| `title` | `string` | `'👁️ 总体预览'` | 弹窗标题 |
|
|
176
|
+
| `excel` | `boolean` | `true` | 显示两个导出 Excel 按钮(普通 / 撑长) |
|
|
177
|
+
| `print` | `boolean` | `true` | 显示两个打印按钮(横版 / 竖版) |
|
|
178
|
+
| `json` | `boolean` | `true` | 显示两个 JSON 按钮(模板 / 数据) |
|
|
179
|
+
|
|
180
|
+
**Events:** `close` — 用户关闭弹窗时触发
|
|
181
|
+
|
|
182
|
+
### `openPreviewStatic(tpl, data?, config?)`
|
|
183
|
+
|
|
184
|
+
命令式调用,一行代码弹出预览。自动挂载到 `document.body`,关闭时自动卸载。
|
|
185
|
+
|
|
186
|
+
```js
|
|
187
|
+
import { openPreviewStatic } from 'vue-quokit';
|
|
188
|
+
|
|
189
|
+
openPreviewStatic(tpl, data, { excel: true, print: false, json: false });
|
|
190
|
+
```
|
|
191
|
+
|
|
161
192
|
### Composables
|
|
162
193
|
|
|
163
194
|
#### `useColumns(initialColumns?, initialGroupRules?)`
|
|
@@ -213,6 +244,8 @@ src/components/vue-quokit/
|
|
|
213
244
|
│ │ └── schema.js
|
|
214
245
|
│ └── preview/ ← 渲染域
|
|
215
246
|
│ ├── QuokitSheet.vue
|
|
247
|
+
│ ├── QuokitPreview.vue
|
|
248
|
+
│ ├── usePreview.js
|
|
216
249
|
│ └── mockData.js
|
|
217
250
|
│
|
|
218
251
|
├── shared/ ← 跨域共享
|