Skip to content

Commit 4e19f9b

Browse files
committed
add example
1 parent 9fd4fbd commit 4e19f9b

File tree

10 files changed

+55
-529
lines changed

10 files changed

+55
-529
lines changed

CHANGE-LOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ V2.12.0
3737
- 支持 `Ctrl + Enter`键停止编辑状态,并停留在当前单元格
3838
- 支持 `Alt + Enter`键单元格内文本换行
3939
- 支持 `Delete`键清空活动单元格内容
40-
- 支持 `BackSpace`键清空活动单元格内容,并进去编辑状态
41-
- 支持 `Space`键清空活动单元格内容填入空格,并进入编辑状态
40+
- 支持 `BackSpace`键清空活动单元格内容,并进入编辑状态
41+
- 支持 `Space`键清空活动单元格内容填入空格
4242
- 支持 `Enter`键停止编辑状态并键向下移动活动单元格
4343
- 支持 `Tab`键停止编辑状态并向右移动活动单元格
4444
- 支持 `Shift + Tab`键停止编辑状态并向左移动活动单元格

examples/src/docs/zh/ve-table/cell-edit/single-click-edit.md renamed to examples/src/docs/zh/ve-table/cell-edit/base.md

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
:::anchor 单击编辑
1+
:::anchor 基本用法
22

3-
:::demo 通过 `doubleClickEdit=false`关闭双击编辑,开启单击编辑单元格
3+
:::demo 单元格停止编辑后将触发`cellValueChange`方法,参数`row`为更新后的行数据信息,参数`column`为当前编辑的列信息
44

55
```html
66
<template>
77
<div>
88
<ve-table
9-
ref="tableRef"
109
rowKeyFieldName="rowKey"
11-
:max-height="300"
1210
:fixed-header="true"
1311
:columns="columns"
1412
:table-data="tableData"
1513
:editOption="editOption"
14+
:rowStyleOption="rowStyleOption"
15+
border-y
1616
/>
1717
</div>
1818
</template>
@@ -21,19 +21,16 @@
2121
export default {
2222
data() {
2323
return {
24+
rowStyleOption: {
25+
clickHighlight: false,
26+
},
2427
// edit option 可控单元格编辑
2528
editOption: {
26-
// disable double click edit
27-
doubleClickEdit: false,
2829
// cell value change
2930
cellValueChange: ({ row, column }) => {
3031
console.log("cellValueChange row::", row);
3132
console.log("cellValueChange column::", column);
3233
},
33-
// row value change
34-
rowValueChange: ({ row }) => {
35-
console.log("rowValueChange row::", row);
36-
},
3734
},
3835
columns: [
3936
{
@@ -53,10 +50,10 @@
5350
edit: true,
5451
},
5552
{
56-
field: "hobby",
57-
key: "hobby",
58-
title: "Hobby",
59-
align: "center",
53+
field: "number",
54+
key: "number",
55+
title: "Number",
56+
align: "right",
6057
width: "30%",
6158
edit: true,
6259
},
@@ -74,35 +71,35 @@
7471
{
7572
name: "John",
7673
date: "1900-05-20",
77-
hobby: "coding and coding repeat",
74+
number: "32",
7875
address: "No.1 Century Avenue, Shanghai",
7976
rowKey: 0,
8077
},
8178
{
8279
name: "Dickerson",
8380
date: "1910-06-20",
84-
hobby: "coding and coding repeat",
81+
number: "676",
8582
address: "No.1 Century Avenue, Beijing",
8683
rowKey: 1,
8784
},
8885
{
8986
name: "Larsen",
9087
date: "2000-07-20",
91-
hobby: "coding and coding repeat",
88+
number: "76",
9289
address: "No.1 Century Avenue, Chongqing",
9390
rowKey: 2,
9491
},
9592
{
9693
name: "Geneva",
9794
date: "2010-08-20",
98-
hobby: "coding and coding repeat",
95+
number: "7797",
9996
address: "No.1 Century Avenue, Xiamen",
10097
rowKey: 3,
10198
},
10299
{
103100
name: "Jami",
104101
date: "2020-09-20",
105-
hobby: "coding and coding repeat",
102+
number: "8978",
106103
address: "No.1 Century Avenue, Shenzhen",
107104
rowKey: 4,
108105
},

examples/src/docs/zh/ve-table/cell-edit/double-click-edit.md renamed to examples/src/docs/zh/ve-table/cell-edit/combine-column-fixed.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
:::anchor 双击编辑
1+
:::anchor 结合固定列
22

3-
你可以通过 `Enter`键配合上、下、左、右键,无需使用鼠标实现编辑操作
4-
5-
:::demo 1、默认双击开启编辑单元格<br>2、单元格停止编辑后将触发`cellValueChange`方法,参数`row`为更新后的行数据信息,参数`column`为当前编辑的列信息
3+
:::demo
64

75
```html
86
<template>
@@ -130,9 +128,9 @@
130128
for (let i = 0; i < 100; i++) {
131129
data.push({
132130
rowKey: i,
133-
col1: i + "aaaaaa",
134-
col2: "",
135-
col3: 111,
131+
col1: i,
132+
col2: i,
133+
col3: i,
136134
col4: i,
137135
col5: i,
138136
col6: i,

examples/src/docs/zh/ve-table/cell-edit/custom-full-row-edit-control.md

Lines changed: 0 additions & 222 deletions
This file was deleted.

examples/src/docs/zh/ve-table/cell-edit/edit-control.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
:::anchor 可控编辑
22

3-
:::demo 1、通过实例方法`startEditingCell({ rowKey, colKey, defaultValue })`开启编辑的单元格<br>2、通过实例方法`stopEditingCell({ rowKey, colKey })`停止编辑的单元格
3+
:::demo 1、通过实例方法`startEditingCell({ rowKey, colKey, defaultValue })`编辑指定的单元格
44

55
```html
66
<template>
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
:::tip
22
1、通过 `editOption`属性配置单元格编辑功能<br>
33
2、通过 `columns` 对象设置`edit=true`允许编辑的列<br>
4-
3、你可以像使用 excel 那样使用快捷键以及编辑
54
:::

0 commit comments

Comments
 (0)