@aimerthyr/virtual-table 1.4.0 → 1.4.1
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/CHANGELOG.md +8 -0
- package/README.en.md +14 -0
- package/README.md +19 -5
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +20 -3
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -0
- package/dist/virtual-table.css +1 -1
- package/package.json +7 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.4.1] - 2026-04-01
|
|
4
|
+
|
|
5
|
+
### Breaking Changes
|
|
6
|
+
|
|
7
|
+
- 重构可编辑功能(支持行编辑和单元格编辑两种模式)
|
|
8
|
+
- 原 setEditingRow 改为 setEditingState,参数调整为 (rowId: string | number | null, columnKey?: string | null)
|
|
9
|
+
- 原 bodyCell 中的 isEditing 改为 isEditingMode,类型调整为 'row' | 'cell' | null
|
|
10
|
+
|
|
3
11
|
## [1.4.0] - 2026-03-22
|
|
4
12
|
|
|
5
13
|
### Features
|
package/README.en.md
CHANGED
|
@@ -84,6 +84,20 @@ Or:
|
|
|
84
84
|
import { VTable } from '@aimerthyr/virtual-table'
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
+
## CDN Usage
|
|
88
|
+
|
|
89
|
+
You can also use the UMD build directly in the browser:
|
|
90
|
+
|
|
91
|
+
```html
|
|
92
|
+
<link rel="stylesheet" href="https://unpkg.com/@aimerthyr/virtual-table/dist/virtual-table.css" />
|
|
93
|
+
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script>
|
|
94
|
+
<script src="https://unpkg.com/@aimerthyr/virtual-table/dist/index.umd.js"></script>
|
|
95
|
+
<script>
|
|
96
|
+
// UMD global name comes from vite lib.name = 'VirtualTable'
|
|
97
|
+
const VTable = window.VirtualTable.default || window.VirtualTable
|
|
98
|
+
</script>
|
|
99
|
+
```
|
|
100
|
+
|
|
87
101
|
## Documentation
|
|
88
102
|
|
|
89
103
|
For the complete API (props / slots / examples), please refer to:
|
package/README.md
CHANGED
|
@@ -99,6 +99,20 @@ import type {
|
|
|
99
99
|
} from '@aimerthyr/virtual-table'
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
+
## CDN 方式
|
|
103
|
+
|
|
104
|
+
支持通过 UMD 产物直接在浏览器中使用:
|
|
105
|
+
|
|
106
|
+
```html
|
|
107
|
+
<link rel="stylesheet" href="https://unpkg.com/@aimerthyr/virtual-table/dist/virtual-table.css" />
|
|
108
|
+
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script>
|
|
109
|
+
<script src="https://unpkg.com/@aimerthyr/virtual-table/dist/index.umd.js"></script>
|
|
110
|
+
<script>
|
|
111
|
+
// UMD 挂载名来自 vite lib.name = 'VirtualTable'
|
|
112
|
+
const VTable = window.VirtualTable.default || window.VirtualTable
|
|
113
|
+
</script>
|
|
114
|
+
```
|
|
115
|
+
|
|
102
116
|
## 常见用法
|
|
103
117
|
|
|
104
118
|
### 1. 启用排序和筛选
|
|
@@ -368,11 +382,11 @@ const handleSelectionChange = (rows: any[]) => {
|
|
|
368
382
|
|
|
369
383
|
组件暴露了以下实例能力:
|
|
370
384
|
|
|
371
|
-
| 方法名
|
|
372
|
-
|
|
|
373
|
-
| `tanstackTable`
|
|
374
|
-
| `scrollToIndex`
|
|
375
|
-
| `
|
|
385
|
+
| 方法名 | 类型 | 说明 |
|
|
386
|
+
| ----------------- | ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
387
|
+
| `tanstackTable` | `Table<TData>` | TanStack Table 实例 |
|
|
388
|
+
| `scrollToIndex` | `(index: number, behavior?: 'auto' \| 'smooth') => void` | 滚动到指定行 |
|
|
389
|
+
| `setEditingState` | `(rowId: string \| number \| null, columnKey?: string \| null) => void` | 设置编辑状态(1. columnKey 为空,则为行编辑 2. columnKey 不为空,则为单元格编辑 3. rowId 传 null,清除编辑状态) |
|
|
376
390
|
|
|
377
391
|
使用示例:
|
|
378
392
|
|