Skip to content

Commit b9a9bad

Browse files
committed
doc refine
1 parent fb0a46e commit b9a9bad

File tree

10 files changed

+150
-3
lines changed

10 files changed

+150
-3
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.columnWidthResizeOption.data"
7+
:columns="db.columnWidthResizeOption.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: "Column Resize Option",
20+
},
21+
desc: {
22+
type: String,
23+
default: "columnWidthResizeOption",
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: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,6 +1194,38 @@ export const db = {
11941194
desc: `The callback method after cell delete. Parameter Description:\r1、<code>data</code>delete data\r2、<code>selectionRangeIndexes</code>The indexs information of delete area\r3、<code>selectionRangeKeys</code>The keys information of delete paste`,
11951195
type: `<code>Function({
11961196
data, selectionRangeIndexes, selectionRangeKeys
1197+
})</code>`,
1198+
optionalVal: "-",
1199+
default: "-",
1200+
},
1201+
],
1202+
columns: columnsType1,
1203+
},
1204+
// 列宽改变配置
1205+
columnWidthResizeOption: {
1206+
data: [
1207+
{
1208+
param: "enable",
1209+
desc: `enable column resize`,
1210+
type: `<code>Boolean</code>`,
1211+
optionalVal: "-",
1212+
default: "false",
1213+
},
1214+
{
1215+
param: "minWidth",
1216+
desc: `min width of resize column`,
1217+
type: `<code>Number</code>`,
1218+
optionalVal: "-",
1219+
default: "30px",
1220+
},
1221+
{
1222+
param: "sizeChange",
1223+
desc: `The callback method after column resize. Parameter Description:\r1、<code>column</code>resize column\r2、<code>differWidth</code>Width of the difference after column resize\r3、<code>columnWidth</code>column width after column resize\r4、<code>tableWidth</code>table width after column resize`,
1224+
type: `<code>Function({
1225+
column,
1226+
differWidth,
1227+
columnWidth,
1228+
tableWidth
11971229
})</code>`,
11981230
optionalVal: "-",
11991231
default: "-",

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
<cellAutofillOption />
4040
<!-- Clipboard Option -->
4141
<clipboardOption />
42+
<!-- Clipboard Option -->
43+
<columnWidthResizeOption />
4244
</div>
4345
</template>
4446
<script>
@@ -62,6 +64,7 @@ import contextmenuHeaderOption from "./contextmenu-header-option-props";
6264
import contextmenuBodyOption from "./contextmenu-body-option-props";
6365
import cellAutofillOption from "./cell-autofill-option-props";
6466
import clipboardOption from "./clipboard-option-props";
67+
import columnWidthResizeOption from "./column-width-resize-option-props";
6568
export default {
6669
components: {
6770
TableProps,
@@ -83,6 +86,7 @@ export default {
8386
contextmenuBodyOption,
8487
cellAutofillOption,
8588
clipboardOption,
89+
columnWidthResizeOption,
8690
},
8791
data() {
8892
return {

examples/src/docs/en/ve-table/column-resize/basic.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
:::anchor 列宽拖动
1+
:::anchor Column Drag
22

3-
:::demo 1、通过 `minWidth`设置列拖动的最小宽度<br>2、通过`sizeChange({ column, differWidth, columnWidth, tableWidth })`列拖动变化的回调信息
3+
You can hover the mouse between two columns and drag
4+
5+
:::demo 1、Set the min width of resize column through `minWidth`<br>2、Get the callback method of resize column changes through `sizeChange({ column, differWidth, columnWidth, tableWidth })`
46

57
```html
68
<template>
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
<template>
22
<div>
3-
<h2>列宽拖动</h2>
3+
<h2>Column Resize</h2>
44
<Explain />
55
<Basic />
6+
<API title="API" anchor="API" />
67
</div>
78
</template>
89
<script>
910
import Explain from "./explain.md";
1011
import Basic from "./basic.md";
12+
import API from "../api/column-width-resize-option-props";
1113
1214
export default {
1315
name: "basic-main",
1416
components: {
1517
Explain,
1618
Basic,
19+
API,
1720
},
1821
};
1922
</script>
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.columnWidthResizeOption.data"
7+
:columns="db.columnWidthResizeOption.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: "columnWidthResizeOption",
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: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,39 @@ export const db = {
11871187
desc: `单元格删除后回调方法。参数说明:\r1、<code>data</code>删除的数据\r2、<code>selectionRangeIndexes</code>删除区域的索引信息\r3、<code>selectionRangeKeys</code>删除区域的key信息`,
11881188
type: `<code>Function({
11891189
data, selectionRangeIndexes, selectionRangeKeys
1190+
})</code>`,
1191+
optionalVal: "-",
1192+
default: "-",
1193+
},
1194+
],
1195+
columns: columnsType1,
1196+
},
1197+
1198+
// 列宽改变配置
1199+
columnWidthResizeOption: {
1200+
data: [
1201+
{
1202+
param: "enable",
1203+
desc: `是否开启列宽可变`,
1204+
type: `<code>Boolean</code>`,
1205+
optionalVal: "-",
1206+
default: "false",
1207+
},
1208+
{
1209+
param: "minWidth",
1210+
desc: `可改变列的最小宽度`,
1211+
type: `<code>Number</code>`,
1212+
optionalVal: "-",
1213+
default: "30px",
1214+
},
1215+
{
1216+
param: "sizeChange",
1217+
desc: `列宽改变后的回调函数。参数说明:\r1、<code>column</code>宽度改变的列信息\r2、<code>differWidth</code>列宽改变后差异的宽度\r3、<code>columnWidth</code>列宽改变后的宽度\r4、<code>tableWidth</code>列宽改变后的表格宽度`,
1218+
type: `<code>Function({
1219+
column,
1220+
differWidth,
1221+
columnWidth,
1222+
tableWidth
11901223
})</code>`,
11911224
optionalVal: "-",
11921225
default: "-",

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
<cellAutofillOption />
4040
<!-- Clipboard Option -->
4141
<clipboardOption />
42+
<!-- Clipboard Option -->
43+
<columnWidthResizeOption />
4244
</div>
4345
</template>
4446
<script>
@@ -62,6 +64,7 @@ import contextmenuHeaderOption from "./contextmenu-header-option-props";
6264
import contextmenuBodyOption from "./contextmenu-body-option-props";
6365
import cellAutofillOption from "./cell-autofill-option-props";
6466
import clipboardOption from "./clipboard-option-props";
67+
import columnWidthResizeOption from "./column-width-resize-option-props";
6568
export default {
6669
components: {
6770
TableProps,
@@ -83,6 +86,7 @@ export default {
8386
contextmenuBodyOption,
8487
cellAutofillOption,
8588
clipboardOption,
89+
columnWidthResizeOption,
8690
},
8791
data() {
8892
return {

examples/src/docs/zh/ve-table/column-resize/basic.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
:::anchor 列宽拖动
22

3+
你可以将鼠标悬浮在两列之间,然后拖动即可
4+
35
:::demo 1、通过 `minWidth`设置列拖动的最小宽度<br>2、通过`sizeChange({ column, differWidth, columnWidth, tableWidth })`列拖动变化的回调信息
46

57
```html

examples/src/docs/zh/ve-table/column-resize/main.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,20 @@
33
<h2>列宽拖动</h2>
44
<Explain />
55
<Basic />
6+
<API title="API" anchor="API" />
67
</div>
78
</template>
89
<script>
910
import Explain from "./explain.md";
1011
import Basic from "./basic.md";
12+
import API from "../api/column-width-resize-option-props";
1113
1214
export default {
1315
name: "basic-main",
1416
components: {
1517
Explain,
1618
Basic,
19+
API,
1720
},
1821
};
1922
</script>

0 commit comments

Comments
 (0)