Skip to content

Commit 103414a

Browse files
committed
refine doc
1 parent 7aade0d commit 103414a

File tree

5 files changed

+110
-1
lines changed

5 files changed

+110
-1
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
:::anchor Basic usage
2+
3+
:::demo
4+
5+
```html
6+
<template>
7+
<div>
8+
<ve-table
9+
:columns="columns"
10+
:table-data="tableData"
11+
borderY
12+
:cell-autofill-option="cellAutofillOption"
13+
:editOption="editOption"
14+
rowKeyFieldName="rowKey"
15+
/>
16+
</div>
17+
</template>
18+
19+
<script>
20+
export default {
21+
data() {
22+
return {
23+
cellAutofillOption: true,
24+
editOption: {
25+
// cell value change
26+
cellValueChange: ({ row, column }) => {},
27+
},
28+
columns: [
29+
{
30+
field: "index",
31+
key: "index",
32+
operationColumn: true,
33+
title: "#",
34+
width: 50,
35+
align: "center",
36+
renderBodyCell: ({ row, column, rowIndex }, h) => {
37+
return ++rowIndex;
38+
},
39+
edit: true,
40+
},
41+
{ field: "col1", key: "col1", title: "Col1", edit: true },
42+
{ field: "col2", key: "col2", title: "Col2" },
43+
{ field: "col3", key: "col3", title: "Col3" },
44+
{ field: "col4", key: "col4", title: "Col4" },
45+
{ field: "col5", key: "col5", title: "Col5" },
46+
{ field: "col6", key: "col6", title: "Col6" },
47+
],
48+
tableData: [],
49+
};
50+
},
51+
methods: {
52+
initTableData() {
53+
let data = [];
54+
for (let i = 0; i < 8; i++) {
55+
data.push({
56+
rowKey: i,
57+
col1: `A${i + 1}`,
58+
col2: `B${i + 1}`,
59+
col3: `C${i + 1}`,
60+
col4: `D${i + 1}`,
61+
col5: `E${i + 1}`,
62+
col6: `F${i + 1}`,
63+
col7: `G${i + 1}`,
64+
col8: `H${i + 1}`,
65+
});
66+
}
67+
this.tableData = data;
68+
},
69+
},
70+
created() {
71+
this.initTableData();
72+
},
73+
};
74+
</script>
75+
```
76+
77+
:::
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
:::tip
2+
1、Set `operationColumn = true` in columns as the operation column <br>
3+
2、The operation column can exchange row positions (under development) and select all current rows (under development). This column function is similar to the operation column function of Excel<br>
4+
3、The cells in the operation column are not allowed to be selected, edited, or automatically filled
5+
6+
:::
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<template>
2+
<div>
3+
<h2>Operation Column</h2>
4+
<Explain />
5+
<Base />
6+
</div>
7+
</template>
8+
<script>
9+
import Explain from "./explain.md";
10+
import Base from "./base.md";
11+
12+
export default {
13+
name: "basic-main",
14+
components: {
15+
Explain,
16+
Base,
17+
},
18+
};
19+
</script>

examples/src/docs/zh/ve-table/operation-column/explain.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
:::tip
2-
1、通过在 columns 设置 operationColumn=true 作为操作列 <br>
2+
1、通过在 columns 设置 `operationColumn=true` 作为操作列 <br>
33
2、操作列可以交换行位置(开发中)、全选当前行(开发中)。此列功能类似 excel 的操作列功能<br>
44
3、操作列的单元格不允许单元格选择、不允许单元格编辑、不允许单元格自动填充
55

examples/src/router/locale/en.router.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@ const config = [
196196
name: "Cell Span",
197197
meta: { keepAlive: true },
198198
},
199+
{
200+
path: "operation-column",
201+
component: () =>
202+
import("@/docs/en/ve-table/operation-column/main.vue"),
203+
name: "operation column",
204+
meta: { keepAlive: true },
205+
},
199206
{
200207
path: "cell-selection",
201208
component: () =>

0 commit comments

Comments
 (0)