Skip to content

Commit 92d914d

Browse files
committed
add doc
1 parent da0d4e7 commit 92d914d

File tree

9 files changed

+137
-6
lines changed

9 files changed

+137
-6
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<template>
2+
<div>
3+
<tpl
4+
:desc="desc"
5+
:anchor="anchor"
6+
:table-data="db.contextmenuBodyOption.data"
7+
:columns="db.contextmenuBodyOption.columns"
8+
/>
9+
</div>
10+
</template>
11+
<script>
12+
import tpl from "@/comp/api-tpl";
13+
import { db } from "./db";
14+
export default {
15+
components: { tpl },
16+
props: {
17+
anchor: {
18+
type: String,
19+
default: "Contextmenu Configuration",
20+
},
21+
desc: {
22+
type: String,
23+
default: "contextmenuBodyOption",
24+
},
25+
},
26+
data() {
27+
return {
28+
db: db,
29+
};
30+
},
31+
};
32+
</script>

examples/src/docs/en/ve-table/api/db.js

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export const db = {
225225
{
226226
param: "virtualScrollOption",
227227
desc: "Virtual scroll configuration, it is recommended to display more than 1000 rows at a time.Refer to virtualScrollOption configuration for details",
228-
type: "<code>Boolean</code>",
228+
type: "<code>Object</code>",
229229
optionalVal: "-",
230230
default: "-",
231231
},
@@ -250,6 +250,13 @@ export const db = {
250250
optionalVal: "-",
251251
default: "-",
252252
},
253+
{
254+
param: "contextmenuBodyOption",
255+
desc: "contextmenu configuration,Refer to contextmenuBodyOption",
256+
type: "<code>Object</code>",
257+
optionalVal: "-",
258+
default: "-",
259+
},
253260
{
254261
param: "eventCustomOption",
255262
desc: `Custom event configuration,Refer to eventCustomOption configuration for details`,
@@ -894,6 +901,27 @@ export const db = {
894901
columns: columnsType1,
895902
},
896903

904+
// 右键菜单配置
905+
contextmenuBodyOption: {
906+
data: [
907+
{
908+
param: "callback",
909+
desc: `The callback of the right-click menu item.<code>type</code>menu type,<code>selection </code>Currently selected cell`,
910+
type: `<code>Function({ type, selection })</code>`,
911+
optionalVal: "-",
912+
default: "-",
913+
},
914+
{
915+
param: "contextmenus",
916+
desc: `contextmenu option. <a href='#/en/doc/base/contextmenu'>contextmenu component</a>`,
917+
type: `<code>Array</code>`,
918+
optionalVal: "-",
919+
default: "-",
920+
},
921+
],
922+
columns: columnsType1,
923+
},
924+
897925
// 单元格选择配置
898926
cellSelectionOption: {
899927
data: [

examples/src/docs/en/ve-table/api/main.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
<CellSelectionOption />
3030
<!-- edit Option -->
3131
<EditOption />
32+
<!-- contextmenu body option -->
33+
<contextmenuBodyOption />
3234
<!-- Event Custom Option -->
3335
<EventCustomOption />
3436
</div>
@@ -50,6 +52,7 @@ import CellStyleOption from "./cell-style-option-props";
5052
import RowStyleOption from "./row-style-option-props";
5153
import CellSelectionOption from "./cell-selection-option-props";
5254
import EditOption from "./edit-option-props";
55+
import contextmenuBodyOption from "./contextmenu-body-option-props";
5356
export default {
5457
components: {
5558
TableProps,
@@ -67,6 +70,7 @@ export default {
6770
SortOption,
6871
CellSelectionOption,
6972
EditOption,
73+
contextmenuBodyOption,
7074
},
7175
data() {
7276
return {
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<template>
2+
<div>
3+
<tpl
4+
:desc="desc"
5+
:anchor="anchor"
6+
:table-data="db.contextmenuBodyOption.data"
7+
:columns="db.contextmenuBodyOption.columns"
8+
/>
9+
</div>
10+
</template>
11+
<script>
12+
import tpl from "@/comp/api-tpl";
13+
import { db } from "./db";
14+
export default {
15+
components: { tpl },
16+
props: {
17+
anchor: {
18+
type: String,
19+
default: "右键菜单配置",
20+
},
21+
desc: {
22+
type: String,
23+
default: "contextmenuBodyOption",
24+
},
25+
},
26+
data() {
27+
return {
28+
db: db,
29+
};
30+
},
31+
};
32+
</script>

examples/src/docs/zh/ve-table/api/db.js

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ export const db = {
231231
{
232232
param: "virtualScrollOption",
233233
desc: "虚拟滚动配置,建议需要一次性展示1000条以上使用。具体见下表 virtualScrollOption 配置。",
234-
type: "<code>Boolean</code>",
234+
type: "<code>Object</code>",
235235
optionalVal: "-",
236236
default: "-",
237237
},
@@ -256,6 +256,13 @@ export const db = {
256256
optionalVal: "-",
257257
default: "-",
258258
},
259+
{
260+
param: "contextmenuBodyOption",
261+
desc: "右键菜单配置,具体见下表 contextmenuBodyOption 配置",
262+
type: "<code>Object</code>",
263+
optionalVal: "-",
264+
default: "-",
265+
},
259266
{
260267
param: "eventCustomOption",
261268
desc: `自定义事件配置,具体见下表 eventCustomOption 配置`,
@@ -900,6 +907,27 @@ export const db = {
900907
columns: columnsType1,
901908
},
902909

910+
// 右键菜单配置
911+
contextmenuBodyOption: {
912+
data: [
913+
{
914+
param: "callback",
915+
desc: `右键菜单项被点击的回调。<code>type</code>菜单类型,<code>selection </code>当前选中单元格`,
916+
type: `<code>Function({ type, selection })</code>`,
917+
optionalVal: "-",
918+
default: "-",
919+
},
920+
{
921+
param: "contextmenus",
922+
desc: `右键菜单配置项。 <a href='#/zh/doc/base/contextmenu'>右键菜单组件</a>`,
923+
type: `<code>Array</code>`,
924+
optionalVal: "-",
925+
default: "-",
926+
},
927+
],
928+
columns: columnsType1,
929+
},
930+
903931
// 单元格选择配置
904932
cellSelectionOption: {
905933
data: [

examples/src/docs/zh/ve-table/api/main.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
<CellSelectionOption />
3030
<!-- edit Option -->
3131
<EditOption />
32+
<!-- contextmenu body option -->
33+
<contextmenuBodyOption />
3234
<!-- Event Custom Option -->
3335
<EventCustomOption />
3436
</div>
@@ -50,6 +52,7 @@ import CellStyleOption from "./cell-style-option-props";
5052
import RowStyleOption from "./row-style-option-props";
5153
import CellSelectionOption from "./cell-selection-option-props";
5254
import EditOption from "./edit-option-props";
55+
import contextmenuBodyOption from "./contextmenu-body-option-props";
5356
export default {
5457
components: {
5558
TableProps,
@@ -67,6 +70,7 @@ export default {
6770
SortOption,
6871
CellSelectionOption,
6972
EditOption,
73+
contextmenuBodyOption,
7074
},
7175
data() {
7276
return {

examples/src/docs/zh/ve-table/contextmenu/base.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@
134134
],
135135
};
136136
},
137-
138-
methods: {},
139137
};
140138
</script>
141139
```

examples/src/docs/zh/ve-table/contextmenu/custom.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,6 @@
178178
],
179179
};
180180
},
181-
182-
methods: {},
183181
};
184182
</script>
185183
```

examples/src/docs/zh/ve-table/contextmenu/main.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@
55
<ContextmenuTypes />
66
<Base />
77
<Custom />
8+
<API
9+
title="API"
10+
anchor="API"
11+
desc="contextmenuBodyOption 右键菜单配置"
12+
/>
813
</div>
914
</template>
1015
<script>
1116
import Explain from "./explain.md";
1217
import ContextmenuTypes from "./contextmenu-types.md";
1318
import Base from "./base.md";
1419
import Custom from "./custom.md";
20+
import API from "../api/contextmenu-body-option-props";
1521
1622
export default {
1723
name: "basic-main",
@@ -20,6 +26,7 @@ export default {
2026
ContextmenuTypes,
2127
Base,
2228
Custom,
29+
API,
2330
},
2431
};
2532
</script>

0 commit comments

Comments
 (0)