Skip to content

Commit c28f807

Browse files
committed
refine doc
1 parent b73d552 commit c28f807

File tree

4 files changed

+168
-4
lines changed

4 files changed

+168
-4
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
:::anchor Disable cell selection
2+
3+
:::demo Cell selection is enable by default, you can disable by `cellSelectionOption.enable = false
4+
5+
```html
6+
<template>
7+
<ve-table
8+
fixed-header
9+
border-y
10+
:columns="columns"
11+
:table-data="tableData"
12+
:cellSelectionOption="cellSelectionOption"
13+
rowKeyFieldName="rowKey"
14+
/>
15+
</template>
16+
17+
<script>
18+
export default {
19+
data() {
20+
return {
21+
cellSelectionOption: {
22+
// disble cell selection
23+
enable: false,
24+
},
25+
columns: [
26+
{ field: "name", key: "a", title: "Name", align: "left" },
27+
{ field: "date", key: "b", title: "Date", align: "left" },
28+
{
29+
field: "hobby",
30+
key: "c",
31+
title: "Hobby",
32+
align: "right",
33+
},
34+
{ field: "address", key: "d", title: "Address" },
35+
],
36+
tableData: [
37+
{
38+
name: "John",
39+
date: "1900-05-20",
40+
hobby: "coding and coding repeat",
41+
address: "No.1 Century Avenue, Shanghai",
42+
rowKey: 0,
43+
},
44+
{
45+
name: "Dickerson",
46+
date: "1910-06-20",
47+
hobby: "coding and coding repeat",
48+
address: "No.1 Century Avenue, Beijing",
49+
rowKey: 1,
50+
},
51+
{
52+
name: "Larsen",
53+
date: "2000-07-20",
54+
hobby: "coding and coding repeat",
55+
address: "No.1 Century Avenue, Chongqing",
56+
rowKey: 2,
57+
},
58+
{
59+
name: "Geneva",
60+
date: "2010-08-20",
61+
hobby: "coding and coding repeat",
62+
address: "No.1 Century Avenue, Xiamen",
63+
rowKey: 3,
64+
},
65+
{
66+
name: "Jami",
67+
date: "2020-09-20",
68+
hobby: "coding and coding repeat",
69+
address: "No.1 Century Avenue, Shenzhen",
70+
rowKey: 4,
71+
},
72+
],
73+
};
74+
},
75+
};
76+
</script>
77+
```
78+
79+
:::

examples/src/docs/en/ve-table/cell-selection/main.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,22 @@
44
<Explain />
55
<ShortCuts />
66
<Base />
7+
<DisableSelection />
78
</div>
89
</template>
910
<script>
1011
import Explain from "./explain.md";
11-
import Base from "./base.md";
1212
import ShortCuts from "./shortcuts.md";
13+
import Base from "./base.md";
14+
import DisableSelection from "./disable-selection.md";
1315
1416
export default {
1517
name: "cell-selection",
1618
components: {
1719
Explain,
18-
Base,
1920
ShortCuts,
21+
Base,
22+
DisableSelection,
2023
},
2124
};
2225
</script>
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
:::anchor 禁用单元格选择
2+
3+
:::demo 默认单元格选择是开启的,你可以通过 `cellSelectionOption.enable = false` 关闭
4+
5+
```html
6+
<template>
7+
<ve-table
8+
fixed-header
9+
border-y
10+
:columns="columns"
11+
:table-data="tableData"
12+
:cellSelectionOption="cellSelectionOption"
13+
rowKeyFieldName="rowKey"
14+
/>
15+
</template>
16+
17+
<script>
18+
export default {
19+
data() {
20+
return {
21+
cellSelectionOption: {
22+
// disble cell selection
23+
enable: false,
24+
},
25+
columns: [
26+
{ field: "name", key: "a", title: "Name", align: "left" },
27+
{ field: "date", key: "b", title: "Date", align: "left" },
28+
{
29+
field: "hobby",
30+
key: "c",
31+
title: "Hobby",
32+
align: "right",
33+
},
34+
{ field: "address", key: "d", title: "Address" },
35+
],
36+
tableData: [
37+
{
38+
name: "John",
39+
date: "1900-05-20",
40+
hobby: "coding and coding repeat",
41+
address: "No.1 Century Avenue, Shanghai",
42+
rowKey: 0,
43+
},
44+
{
45+
name: "Dickerson",
46+
date: "1910-06-20",
47+
hobby: "coding and coding repeat",
48+
address: "No.1 Century Avenue, Beijing",
49+
rowKey: 1,
50+
},
51+
{
52+
name: "Larsen",
53+
date: "2000-07-20",
54+
hobby: "coding and coding repeat",
55+
address: "No.1 Century Avenue, Chongqing",
56+
rowKey: 2,
57+
},
58+
{
59+
name: "Geneva",
60+
date: "2010-08-20",
61+
hobby: "coding and coding repeat",
62+
address: "No.1 Century Avenue, Xiamen",
63+
rowKey: 3,
64+
},
65+
{
66+
name: "Jami",
67+
date: "2020-09-20",
68+
hobby: "coding and coding repeat",
69+
address: "No.1 Century Avenue, Shenzhen",
70+
rowKey: 4,
71+
},
72+
],
73+
};
74+
},
75+
};
76+
</script>
77+
```
78+
79+
:::

examples/src/docs/zh/ve-table/cell-selection/main.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,22 @@
44
<Explain />
55
<ShortCuts />
66
<Base />
7+
<DisableSelection />
78
</div>
89
</template>
910
<script>
1011
import Explain from "./explain.md";
11-
import Base from "./base.md";
1212
import ShortCuts from "./shortcuts.md";
13+
import Base from "./base.md";
14+
import DisableSelection from "./disable-selection.md";
1315
1416
export default {
1517
name: "cell-selection",
1618
components: {
1719
Explain,
18-
Base,
1920
ShortCuts,
21+
Base,
22+
DisableSelection,
2023
},
2124
};
2225
</script>

0 commit comments

Comments
 (0)