auto-vue-manual 0.0.30 → 0.0.32
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 +147 -142
- package/dist/auto-vue-manual.es.js +34293 -1105
- package/dist/auto-vue-manual.umd.js +85 -3
- package/dist/index.css +1 -1
- package/dist/types/components/button/openButton.vue.d.ts +128 -0
- package/dist/types/components/button/refreshButton.vue.d.ts +137 -0
- package/dist/types/components/button/resetButton.vue.d.ts +128 -0
- package/dist/types/components/button/searchButton.vue.d.ts +128 -0
- package/dist/types/components/index.d.ts +5 -1
- package/dist/types/components/loading/loading.d.ts +35 -0
- package/dist/types/components/modal/basicDialog.vue.d.ts +126 -14
- package/dist/types/components/modal/basicDrawer.vue.d.ts +144 -14
- package/dist/types/components/modal/formDialog.vue.d.ts +7 -112
- package/dist/types/components/table/components/TableColumnV2.d.ts +2 -2
- package/dist/types/components/table/hook/useAutoHeight.d.ts +2 -2
- package/dist/types/components/table/hook/useTable.d.ts +2 -2
- package/dist/types/components/table/index.vue.d.ts +12 -20
- package/dist/types/components/table/list.vue.d.ts +4 -4
- package/dist/types/components/table/summary.vue.d.ts +5 -5
- package/dist/types/components/tinymce/index.vue.d.ts +143 -0
- package/dist/types/types/table.d.ts +11 -10
- package/dist/version.js +1 -1
- package/package.json +19 -3
- package/dist/types/components/modal/tableDialog.vue.d.ts +0 -100
- package/dist/types/components/table/components/loading.d.ts +0 -2
package/README.md
CHANGED
|
@@ -43,6 +43,64 @@ app.mount('#app');
|
|
|
43
43
|
[UploadImage](#uploadimage)
|
|
44
44
|
[UploadImages](#uploadimages)
|
|
45
45
|
|
|
46
|
+
## Button
|
|
47
|
+
|
|
48
|
+
### 组件列表
|
|
49
|
+
- OpenButton 新建按钮
|
|
50
|
+
- RefreshButton 刷新按钮
|
|
51
|
+
- SearchButton 搜索按钮
|
|
52
|
+
- ResetButton 重置按钮
|
|
53
|
+
|
|
54
|
+
### 通用 Props
|
|
55
|
+
| 属性名 | 类型 | 说明 | 默认值 |
|
|
56
|
+
|-----------|---------|----------------|----------|
|
|
57
|
+
| type | string | 按钮类型 | 'primary'(Open/Search),'default'(Refresh),'warning'(Reset)|
|
|
58
|
+
| size | string | 按钮尺寸 | 'default'|
|
|
59
|
+
| showIcon | boolean | 是否显示图标 | true |
|
|
60
|
+
| circle | boolean | 是否圆形按钮 | true |
|
|
61
|
+
| plain | boolean | 是否朴素按钮 | false |
|
|
62
|
+
| disabled | boolean | 是否禁用 | false |
|
|
63
|
+
| loading | boolean | 是否加载中 | false |
|
|
64
|
+
| t | string | 按钮文本 | '' |
|
|
65
|
+
|
|
66
|
+
### OpenButton
|
|
67
|
+
- 用于新建操作,蓝色圆形加号图标。
|
|
68
|
+
- 事件:`@open` 点击触发
|
|
69
|
+
|
|
70
|
+
### RefreshButton
|
|
71
|
+
- 用于刷新操作,圆形刷新图标。
|
|
72
|
+
- 事件:`@refresh` 点击触发
|
|
73
|
+
- 支持 loading 状态自定义
|
|
74
|
+
|
|
75
|
+
### SearchButton
|
|
76
|
+
- 用于搜索操作,蓝色圆形放大镜图标。
|
|
77
|
+
- 事件:`@search` 点击触发
|
|
78
|
+
|
|
79
|
+
### ResetButton
|
|
80
|
+
- 用于重置操作,橙色圆形刷新图标。
|
|
81
|
+
- 事件:`@reset` 点击触发
|
|
82
|
+
|
|
83
|
+
### 示例代码
|
|
84
|
+
```vue
|
|
85
|
+
<template>
|
|
86
|
+
<OpenButton @open="onOpen" />
|
|
87
|
+
<RefreshButton :loading="loading" @refresh="onRefresh" />
|
|
88
|
+
<SearchButton t="搜索" @search="onSearch" />
|
|
89
|
+
<ResetButton t="重置" @reset="onReset" />
|
|
90
|
+
</template>
|
|
91
|
+
<script setup lang="ts">
|
|
92
|
+
import { ref } from 'vue';
|
|
93
|
+
import { OpenButton, RefreshButton, SearchButton, ResetButton } from 'auto-vue-manual';
|
|
94
|
+
const loading = ref(false);
|
|
95
|
+
const onOpen = () => { /* 新建逻辑 */ };
|
|
96
|
+
const onRefresh = () => {
|
|
97
|
+
loading.value = true;
|
|
98
|
+
setTimeout(() => loading.value = false, 1000);
|
|
99
|
+
};
|
|
100
|
+
const onSearch = () => { /* 搜索逻辑 */ };
|
|
101
|
+
const onReset = () => { /* 重置逻辑 */ };
|
|
102
|
+
</script>
|
|
103
|
+
```
|
|
46
104
|
|
|
47
105
|
# Document
|
|
48
106
|
|
|
@@ -250,167 +308,76 @@ const onRowDblclick = (row: RowEventHandlerParams) => {
|
|
|
250
308
|
</script>
|
|
251
309
|
```
|
|
252
310
|
|
|
253
|
-
## Modal
|
|
311
|
+
## Modal 弹窗/抽屉
|
|
312
|
+
|
|
313
|
+
### 统一说明
|
|
314
|
+
- 所有弹窗类组件(BasicDialog、FormDialog、TableDialog)均基于 BasicDialog 实现,props/事件/用法风格统一。
|
|
315
|
+
- 所有抽屉类组件均基于 BasicDrawer 实现。
|
|
316
|
+
- 支持 v-bind 透传 Element Plus Dialog/Drawer 的所有原生属性。
|
|
317
|
+
|
|
318
|
+
### 通用 Props
|
|
319
|
+
| 属性名 | 类型 | 说明 | 默认值 |
|
|
320
|
+
|----------------|-----------|----------------|----------|
|
|
321
|
+
| visible | boolean | 是否显示 | false |
|
|
322
|
+
| showClose | boolean | 是否显示关闭按钮 | true |
|
|
323
|
+
| title | string | 标题 | Title |
|
|
324
|
+
| width | string | 宽度 | 520px |
|
|
325
|
+
| top | string | 顶部距离 | 15vh |
|
|
326
|
+
| dialogProps | object | 透传 Dialog/Drawer 属性 | {} |
|
|
327
|
+
| appendToBody | boolean | 是否插入 body | true |
|
|
328
|
+
| lockScroll | boolean | 是否锁定滚动 | true |
|
|
329
|
+
| closeOnClickModal | boolean | 点击遮罩关闭 | false |
|
|
254
330
|
|
|
255
331
|
### BasicDialog
|
|
332
|
+
- 通用弹窗基类,支持所有通用 props 和事件。
|
|
333
|
+
- 事件:`@update:visible`、`@closed`、`@submit`
|
|
256
334
|
|
|
257
|
-
|
|
335
|
+
### BasicDrawer
|
|
336
|
+
- 通用抽屉基类,支持所有通用 props 和事件。
|
|
337
|
+
- 事件:`@update:visible`、`@closed`
|
|
258
338
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
| **title** | `string` | 标题 | Title |
|
|
264
|
-
| **width** | `string` | 宽度 | 520px |
|
|
265
|
-
| **top** | `string` | 顶部距离 | 15vh |
|
|
266
|
-
| **dialog-props** | `object` | 对话框属性 | {} |
|
|
339
|
+
### FormDialog
|
|
340
|
+
- 基于 BasicDialog 扩展,内置底部按钮,适合表单场景。
|
|
341
|
+
- 额外 props:`executing`(是否执行中)、`footer`(是否显示底部)、`btnSize`、`okText`、`cancelText`
|
|
342
|
+
- 事件:`@submit`、`@closed`、`@before-close`
|
|
267
343
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
| ------ | ---- | ---- |
|
|
272
|
-
| **@closed** | 关闭事件 | - |
|
|
273
|
-
| **@submit** | 确定事件 | - |
|
|
274
|
-
|
|
275
|
-
#### 示例代码
|
|
344
|
+
### TableDialog
|
|
345
|
+
- 基于 BasicDialog 扩展,适合表格弹窗场景。
|
|
346
|
+
- 额外 props:`requesting`(是否请求中)
|
|
276
347
|
|
|
348
|
+
### 示例代码
|
|
277
349
|
```vue
|
|
278
350
|
<template>
|
|
279
|
-
<
|
|
351
|
+
<OpenButton @open="visible = true" />
|
|
352
|
+
<BasicDialog :visible="visible" title="标题" width="520px" @update:visible="visible = $event" @closed="onClosed">
|
|
353
|
+
<template #default>内容区域</template>
|
|
354
|
+
</BasicDialog>
|
|
280
355
|
</template>
|
|
281
356
|
<script setup lang="ts">
|
|
282
|
-
import { ref } from
|
|
283
|
-
import BasicDialog from
|
|
284
|
-
|
|
285
|
-
const basicDialogRef = ref<InstanceType<typeof BasicDialog>>();
|
|
357
|
+
import { ref } from 'vue';
|
|
358
|
+
import { BasicDialog, OpenButton } from 'auto-vue-manual';
|
|
286
359
|
const visible = ref(false);
|
|
287
|
-
|
|
288
|
-
const onClosed = () => {
|
|
289
|
-
console.log("onClosed");
|
|
290
|
-
};
|
|
291
|
-
const onSubmit = () => {
|
|
292
|
-
console.log("onSubmit");
|
|
293
|
-
};
|
|
360
|
+
const onClosed = () => { visible.value = false; };
|
|
294
361
|
</script>
|
|
295
362
|
```
|
|
296
363
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
#### Props 参数说明
|
|
300
|
-
|
|
301
|
-
| 属性名 | 类型 | 说明 | 默认值 |
|
|
302
|
-
| ------ | ---- | ---- | ------ |
|
|
303
|
-
| **visible** | `boolean` | 是否显示 | false |
|
|
304
|
-
| **show-close** | `boolean` | 是否显示关闭按钮 | true |
|
|
305
|
-
| **title** | `string` | 标题 | Title |
|
|
306
|
-
| **width** | `string` | 宽度 | 520px |
|
|
307
|
-
| **dialog-props** | `object` | 对话框属性 | {} |
|
|
308
|
-
|
|
309
|
-
#### Event 事件说明
|
|
310
|
-
|
|
311
|
-
| 事件名 | 说明 | 参数 |
|
|
312
|
-
| ------ | ---- | ---- |
|
|
313
|
-
| **@closed** | 关闭事件 | - |
|
|
314
|
-
|
|
315
|
-
#### 示例代码
|
|
316
|
-
|
|
364
|
+
### FormDialog 示例
|
|
317
365
|
```vue
|
|
318
366
|
<template>
|
|
319
|
-
<
|
|
320
|
-
|
|
321
|
-
<
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
const basicDrawerRef = ref<InstanceType<typeof BasicDrawer>>();
|
|
326
|
-
const visible = ref(false);
|
|
327
|
-
|
|
328
|
-
const onClosed = () => {
|
|
329
|
-
console.log("onClosed");
|
|
330
|
-
};
|
|
331
|
-
</script>
|
|
332
|
-
```
|
|
333
|
-
|
|
334
|
-
## FormDialog
|
|
335
|
-
|
|
336
|
-
#### Props 参数说明
|
|
337
|
-
|
|
338
|
-
| 属性名 | 类型 | 说明 | 默认值 |
|
|
339
|
-
| ------ | ---- | ---- | ------ |
|
|
340
|
-
| **executing** | `boolean` | 是否执行中 | false |
|
|
341
|
-
| **footer** | `boolean` | 是否显示底部 | true |
|
|
342
|
-
| **btn-size** | `string` | 按钮大小 | default |
|
|
343
|
-
| **ok-text** | `string` | 确定按钮文本 | base.submit |
|
|
344
|
-
| **cancel-text** | `string` | 取消按钮文本 | base.cancel |
|
|
345
|
-
|
|
346
|
-
其余同 [BasicDialog](#basicdialog)
|
|
347
|
-
|
|
348
|
-
#### Event 事件说明
|
|
349
|
-
|
|
350
|
-
| 事件名 | 说明 | 参数 |
|
|
351
|
-
| ------ | ---- | ---- |
|
|
352
|
-
| **@closed** | 关闭事件 | - |
|
|
353
|
-
| **@submit** | 确定事件 | - |
|
|
354
|
-
| **@before-close** | 关闭前事件 | - |
|
|
355
|
-
|
|
356
|
-
#### 示例代码
|
|
357
|
-
|
|
358
|
-
```vue
|
|
359
|
-
<template>
|
|
360
|
-
<FormDialog ref="formDialogRef" :visible="visible" title="user.name" width="520px" @closed="onClosed" @submit="onSubmit" @before-close="onBeforeClose" />
|
|
367
|
+
<OpenButton @open="visible = true" />
|
|
368
|
+
<FormDialog :visible="visible" title="表单弹窗" @update:visible="visible = $event" @submit="onSubmit">
|
|
369
|
+
<template #default>
|
|
370
|
+
<el-input v-model="form.name" placeholder="请输入名称" />
|
|
371
|
+
</template>
|
|
372
|
+
</FormDialog>
|
|
361
373
|
</template>
|
|
362
374
|
<script setup lang="ts">
|
|
363
|
-
import { ref } from
|
|
364
|
-
import FormDialog from
|
|
365
|
-
|
|
366
|
-
const formDialogRef = ref<InstanceType<typeof FormDialog>>();
|
|
375
|
+
import { ref } from 'vue';
|
|
376
|
+
import { FormDialog, OpenButton } from 'auto-vue-manual';
|
|
367
377
|
const visible = ref(false);
|
|
368
|
-
|
|
369
|
-
const
|
|
370
|
-
console.log("onClosed");
|
|
371
|
-
};
|
|
372
|
-
const onSubmit = () => {
|
|
373
|
-
console.log("onSubmit");
|
|
374
|
-
};
|
|
375
|
-
const onBeforeClose = () => {
|
|
376
|
-
console.log("onBeforeClose");
|
|
377
|
-
};
|
|
378
|
+
const form = ref({ name: '' });
|
|
379
|
+
const onSubmit = () => { /* 提交逻辑 */ };
|
|
378
380
|
</script>
|
|
379
|
-
```
|
|
380
|
-
|
|
381
|
-
## TableDialog
|
|
382
|
-
|
|
383
|
-
#### Props 参数说明
|
|
384
|
-
|
|
385
|
-
| 属性名 | 类型 | 说明 | 默认值 |
|
|
386
|
-
| ------ | ---- | ---- | ------ |
|
|
387
|
-
| **requesting** | `boolean` | 是否请求中 | false |
|
|
388
|
-
|
|
389
|
-
其余同 [BasicDialog](#basicdialog)
|
|
390
|
-
|
|
391
|
-
#### Event 事件说明
|
|
392
|
-
|
|
393
|
-
| 事件名 | 说明 | 参数 |
|
|
394
|
-
| ------ | ---- | ---- |
|
|
395
|
-
| **@closed** | 关闭事件 | - |
|
|
396
|
-
|
|
397
|
-
#### 示例代码
|
|
398
|
-
|
|
399
|
-
```vue
|
|
400
|
-
<template>
|
|
401
|
-
<TableDialog ref="tableDialogRef" :visible="visible" title="user.name" width="520px" @closed="onClosed" />
|
|
402
|
-
</template>
|
|
403
|
-
<script setup lang="ts">
|
|
404
|
-
import { ref } from "vue";
|
|
405
|
-
import TableDialog from "auto-vue-manual";
|
|
406
|
-
|
|
407
|
-
const tableDialogRef = ref<InstanceType<typeof TableDialog>>();
|
|
408
|
-
const visible = ref(false);
|
|
409
|
-
|
|
410
|
-
const onClosed = () => {
|
|
411
|
-
console.log("onClosed");
|
|
412
|
-
};
|
|
413
|
-
</script>
|
|
414
381
|
```
|
|
415
382
|
|
|
416
383
|
## Upload
|
|
@@ -479,4 +446,42 @@ import UploadImages from "auto-vue-manual";
|
|
|
479
446
|
|
|
480
447
|
const uploadImagesRef = ref<InstanceType<typeof UploadImages>>();
|
|
481
448
|
const images = ref<FileList[]>([]);
|
|
482
|
-
</script>
|
|
449
|
+
</script>
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
## Tinymce 富文本编辑器
|
|
453
|
+
|
|
454
|
+
### 组件说明
|
|
455
|
+
基于 tinymce 封装的富文本编辑器,支持图片上传、字数统计、代码高亮等常用功能,适用于内容管理、文章编辑等场景。
|
|
456
|
+
|
|
457
|
+
### Props 参数说明
|
|
458
|
+
| 属性名 | 类型 | 说明 | 默认值 |
|
|
459
|
+
|----------|---------|----------------------|----------------|
|
|
460
|
+
| url | string | 图片上传接口 | /upload/image |
|
|
461
|
+
| content | string | 编辑器内容(v-model)| '' |
|
|
462
|
+
| height | number | 编辑器高度 | 600 |
|
|
463
|
+
| disabled | boolean | 是否禁用编辑 | false |
|
|
464
|
+
|
|
465
|
+
### 事件
|
|
466
|
+
| 事件名 | 说明 | 参数 |
|
|
467
|
+
|------------------|--------------------|--------------|
|
|
468
|
+
| update:content | 内容变更时触发 | value: string|
|
|
469
|
+
|
|
470
|
+
### 功能特性
|
|
471
|
+
- 支持图片粘贴/上传,自动调用 `url` 接口
|
|
472
|
+
- 支持字数统计、代码高亮、列表、字体样式等
|
|
473
|
+
- 支持自定义高度、禁用状态
|
|
474
|
+
- 默认中文界面
|
|
475
|
+
|
|
476
|
+
### 示例代码
|
|
477
|
+
```vue
|
|
478
|
+
<template>
|
|
479
|
+
<Tinymce v-model:content="content" :height="400" :url="'/upload/image'" />
|
|
480
|
+
<p>内容:{{ content }}</p>
|
|
481
|
+
</template>
|
|
482
|
+
<script setup lang="ts">
|
|
483
|
+
import { ref } from 'vue';
|
|
484
|
+
import Tinymce from 'auto-vue-manual';
|
|
485
|
+
const content = ref('<p>初始内容</p>');
|
|
486
|
+
</script>
|
|
487
|
+
```
|