Skip to content

Commit 6760317

Browse files
docs: ✏️ 补充Table组件关于Events的介绍
Closes: #260
1 parent caf66b6 commit 6760317

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

docs/component/table.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -234,16 +234,23 @@ function handleSort(e) {
234234

235235
## Attributes
236236

237-
| 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 |
238-
| ---------- | ------------------------------------------------- | ---------------------------- | ------ | ------ | ---------------- |
239-
| data | 显示的数据 | Array | - | - | 0.0.39 |
240-
| border | 是否带有边框 | boolean | - | true | 0.0.39 |
241-
| stripe | 是否为斑马纹表 | boolean | - | true | 0.0.39 |
242-
| height | Table 的高度,默认为`80vh` | string | - | `80vh` | 0.0.39 |
243-
| rowHeight | 行高 | `number / string` | - | 50 | 0.0.39 |
244-
| showHeader | 是否显示表头 | boolean | - | true | 0.0.39 |
245-
| ellipsis | 是否超出 2 行隐藏 | boolean | - | true | 0.0.39 |
246-
| index | 是否显示索引列,可传入`boolean`也可传入column配置 | `boolean / TableColumnProps` | | false | $LOWEST_VERSION$ |
237+
| 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 |
238+
| ---------- | --------------------------------------------------- | ---------------------------- | ------ | ------ | ---------------- |
239+
| data | 显示的数据 | Array | - | - | 0.0.39 |
240+
| border | 是否带有边框 | boolean | - | true | 0.0.39 |
241+
| stripe | 是否为斑马纹表 | boolean | - | true | 0.0.39 |
242+
| height | Table 的高度,默认为`80vh` | string | - | `80vh` | 0.0.39 |
243+
| rowHeight | 行高 | `number / string` | - | 50 | 0.0.39 |
244+
| showHeader | 是否显示表头 | boolean | - | true | 0.0.39 |
245+
| ellipsis | 是否超出 2 行隐藏 | boolean | - | true | 0.0.39 |
246+
| index | 是否显示索引列,可传入`boolean`也可传入 column 配置 | `boolean / TableColumnProps` | | false | $LOWEST_VERSION$ |
247+
248+
## Events
249+
250+
| 事件名称 | 说明 | 参数 | 最低版本 |
251+
| ----------- | ------------------------------------------------------------------ | -------------------------------- | -------- |
252+
| sort-method | 指定数据按照哪个属性进行排序,仅当 sortable 设置为 true 的时候有效 | `TableColumn:当前点击列数据` | 0.0.39 |
253+
| row-click | 当某一行被点击时会触发该事件 | `{rowIndex:number} 点击行的下标` | 0.0.39 |
247254

248255
## TableColumn Attributes
249256

src/uni_modules/wot-design-uni/components/wd-table/wd-table.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ import { useTranslate } from '../composables/useTranslate'
8181
const { translate } = useTranslate('tableCol')
8282
8383
const props = defineProps(tableProps)
84-
const emit = defineEmits(['click', 'sort-method', 'row-click'])
84+
const emit = defineEmits(['sort-method', 'row-click'])
8585
const reactiveState = reactive({
8686
data: props.data,
8787
stripe: props.stripe,

0 commit comments

Comments
 (0)