stk-table-vue 0.2.1 → 0.2.3

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,8 @@ Vue3 简易虚拟滚动表格。用于实时数据展示,新数据行高亮渐
5
5
  Vue2.7支持引入源码(**ts**)使用。
6
6
 
7
7
  ## Bug TODO:
8
- * [] props.dataSource 为 shallowRef 时,高亮行不生效。(2024.02.21)
8
+ * [x] props.dataSource 为 shallowRef 时,高亮行不生效。(bug:2024.02.21)(resolved:0.2.3)
9
+
9
10
  ## Feature TODO:
10
11
  * [x] 高亮行,单元格。
11
12
  * [x] 虚拟滚动。
@@ -22,7 +23,7 @@ Vue2.7支持引入源码(**ts**)使用。
22
23
  * [x] 表头拖动调整列宽。
23
24
  * [x] 排序
24
25
  - [x] 基本表头点击排序。
25
- - [] 支持配置 `null` | `undefined` 永远排最后。
26
+ - [x] 支持配置 `null` | `undefined` 永远排最后。
26
27
  - [] 支持配置 string 使用 `String.prototype.localCompare` 排序。
27
28
  * 多级表头。
28
29
  - [x] 支持最多`2级`表头。
@@ -126,9 +127,9 @@ export type StkProps = {
126
127
  /** 表格数据源 */
127
128
  dataSource?: any[];
128
129
  /** 行唯一键 */
129
- rowKey?: UniqKey;
130
+ rowKey?: UniqKeyProp;
130
131
  /** 列唯一键 */
131
- colKey?: UniqKey;
132
+ colKey?: UniqKeyProp;
132
133
  /** 空值展示文字 */
133
134
  emptyCellText?: string;
134
135
  /** 暂无数据兜底高度是否撑满 */
@@ -178,6 +179,16 @@ export type StkProps = {
178
179
  fixedColShadow?: boolean;
179
180
  /** 优化vue2 滚动 */
180
181
  optimizeVue2Scroll?: boolean;
182
+ /** 排序配置 */
183
+ sortConfig?: {
184
+ /** 空值是否排最下面 */
185
+ emptyToBottom: boolean,
186
+ /** 默认排序(1.初始化时触发 2.排序方向为null时触发) */
187
+ defaultSort?: {
188
+ dataIndex: keyof T;
189
+ order: Order;
190
+ };
191
+ },
181
192
  };
182
193
  ```
183
194
  #### Emits
@@ -187,7 +198,7 @@ export type StkProps = {
187
198
  * 排序变更触发
188
199
  * ```(col: StkTableColumn<DT>, order: Order, data: DT[])```
189
200
  */
190
- (e: 'sort-change', col: StkTableColumn<DT>, order: Order, data: DT[]): void;
201
+ (e: 'sort-change', col: StkTableColumn<DT>, order: Order, data: DT[], sortConfig: SortConfig): void;
191
202
  /**
192
203
  * 一行点击事件
193
204
  * ```(ev: MouseEvent, row: DT)```