Skip to content

Commit 6b51afa

Browse files
committed
doc refine
1 parent ca663ab commit 6b51afa

File tree

6 files changed

+36
-34
lines changed

6 files changed

+36
-34
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,12 +1220,11 @@ export const db = {
12201220
},
12211221
{
12221222
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`,
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`,
12241224
type: `<code>Function({
12251225
column,
12261226
differWidth,
12271227
columnWidth,
1228-
tableWidth
12291228
})</code>`,
12301229
optionalVal: "-",
12311230
default: "-",

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

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
:::anchor Column Drag
22

3-
You can hover the mouse between two columns and drag
3+
You can hover the mouse between two columns and drag.If the column width is not set, the default is 50px
44

5-
:::demo 1、Set the min width of resize column through `columnMinWidth`<br>2、Get the callback method of resize column changes through `sizeChange({ column, differWidth, columnWidth, tableWidth })`
5+
:::demo 1、Set the min width of resize column through `columnMinWidth`<br>2、Get the callback method of resize column changes through `sizeChange({ column, differWidth, columnWidth })`
66

77
```html
88
<template>
@@ -11,7 +11,6 @@ You can hover the mouse between two columns and drag
1111
<div>column:{{columnResizeInfo.column}}</div>
1212
<div>differWidth:{{columnResizeInfo.differWidth}}</div>
1313
<div>columnWidth:{{columnResizeInfo.columnWidth}}</div>
14-
<div>tableWidth:{{columnResizeInfo.tableWidth}}</div>
1514
</div>
1615
<ve-table
1716
style="width:100%"
@@ -27,20 +26,20 @@ You can hover the mouse between two columns and drag
2726
</template>
2827

2928
<script>
29+
import Mock from "mockjs";
3030
export default {
3131
data() {
3232
return {
3333
columnWidthResizeOption: {
3434
// default false
3535
enable: true,
3636
// column resize min width
37-
columnMinWidth: 30,
37+
minWidth: 30,
3838
// column size change
39-
sizeChange: ({ column, differWidth, columnWidth, tableWidth }) => {
39+
sizeChange: ({ column, differWidth, columnWidth }) => {
4040
this.columnResizeInfo.column = column;
4141
this.columnResizeInfo.differWidth = differWidth;
4242
this.columnResizeInfo.columnWidth = columnWidth;
43-
this.columnResizeInfo.tableWidth = tableWidth;
4443
},
4544
},
4645
columns: [
@@ -55,12 +54,14 @@ You can hover the mouse between two columns and drag
5554
return ++rowIndex;
5655
},
5756
},
58-
{ field: "col1", key: "col1", title: "Col1" },
59-
{ field: "col2", key: "col2", title: "Col2" },
60-
{ field: "col3", key: "col3", title: "Col3" },
61-
{ field: "col4", key: "col4", title: "Col4" },
62-
{ field: "col5", key: "col5", title: "Col5" },
63-
{ field: "col6", key: "col6", title: "Col6" },
57+
{ field: "col1", key: "col1", title: "Col1", width: 220 },
58+
{ field: "col2", key: "col2", title: "Col2", width: 220 },
59+
{ field: "col3", key: "col3", title: "Col3", width: 220 },
60+
{ field: "col4", key: "col4", title: "Col4", width: 220 },
61+
{ field: "col5", key: "col5", title: "Col5", width: 220 },
62+
{ field: "col6", key: "col6", title: "Col6", width: 220 },
63+
{ field: "col7", key: "col7", title: "Col7" },
64+
{ field: "col8", key: "col8", title: "Col8" },
6465
],
6566
columnResizeInfo: {
6667
column: "",
@@ -74,11 +75,11 @@ You can hover the mouse between two columns and drag
7475
methods: {
7576
initTableData() {
7677
let data = [];
77-
for (let i = 0; i < 8; i++) {
78+
for (let i = 0; i < 5; i++) {
7879
data.push({
7980
rowKey: i,
8081
col1: `A${i + 1}`,
81-
col2: `B${i + 1}`,
82+
col2: Mock.Random.sentence(3, 12),
8283
col3: `C${i + 1}`,
8384
col4: `D${i + 1}`,
8485
col5: `E${i + 1}`,
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
:::tip
22
1、Column width resize is useful when large text exists<br>
33
2、Configure the column width resize through `columnWidthResizeOption`<br>
4-
3、It is recommended to set `scroll-width=0`, then dragging the column width will change the table width
4+
3、It is recommended to set `scroll-width=0`. When the total column width is greater than the container width, a horizontal scroll bar will appear<br>
5+
4、Set the default width of the column through `column.width`. If the total width of all columns is less than the container width, the column width will be adaptive
56
:::

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,12 +1214,11 @@ export const db = {
12141214
},
12151215
{
12161216
param: "sizeChange",
1217-
desc: `列宽改变后的回调函数。参数说明:\r1、<code>column</code>宽度改变的列信息\r2、<code>differWidth</code>列宽改变后差异的宽度\r3、<code>columnWidth</code>列宽改变后的宽度\r4、<code>tableWidth</code>列宽改变后的表格宽度`,
1217+
desc: `列宽改变后的回调函数。参数说明:\r1、<code>column</code>宽度改变的列信息\r2、<code>differWidth</code>列宽改变后差异的宽度\r3、<code>columnWidth</code>列宽改变后的宽度`,
12181218
type: `<code>Function({
12191219
column,
12201220
differWidth,
12211221
columnWidth,
1222-
tableWidth
12231222
})</code>`,
12241223
optionalVal: "-",
12251224
default: "-",

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

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
:::anchor 列宽拖动
22

3-
你可以将鼠标悬浮在两列之间,然后拖动即可
3+
你可以将鼠标悬浮在两列之间,然后拖动即可。如果列宽度不设置,默认是 50px
44

5-
:::demo 1、通过 `columnMinWidth`设置列拖动的最小宽度<br>2、通过`sizeChange({ column, differWidth, columnWidth, tableWidth })`列拖动变化的回调信息
5+
:::demo 1、通过 `minWidth`设置列拖动的最小宽度<br>2、通过`sizeChange({ column, differWidth, columnWidth })`列拖动变化的回调信息
66

77
```html
88
<template>
@@ -11,7 +11,6 @@
1111
<div>column:{{columnResizeInfo.column}}</div>
1212
<div>differWidth:{{columnResizeInfo.differWidth}}</div>
1313
<div>columnWidth:{{columnResizeInfo.columnWidth}}</div>
14-
<div>tableWidth:{{columnResizeInfo.tableWidth}}</div>
1514
</div>
1615
<ve-table
1716
style="width:100%"
@@ -27,20 +26,20 @@
2726
</template>
2827

2928
<script>
29+
import Mock from "mockjs";
3030
export default {
3131
data() {
3232
return {
3333
columnWidthResizeOption: {
3434
// default false
3535
enable: true,
3636
// column resize min width
37-
columnMinWidth: 30,
37+
minWidth: 30,
3838
// column size change
39-
sizeChange: ({ column, differWidth, columnWidth, tableWidth }) => {
39+
sizeChange: ({ column, differWidth, columnWidth }) => {
4040
this.columnResizeInfo.column = column;
4141
this.columnResizeInfo.differWidth = differWidth;
4242
this.columnResizeInfo.columnWidth = columnWidth;
43-
this.columnResizeInfo.tableWidth = tableWidth;
4443
},
4544
},
4645
columns: [
@@ -55,12 +54,14 @@
5554
return ++rowIndex;
5655
},
5756
},
58-
{ field: "col1", key: "col1", title: "Col1" },
59-
{ field: "col2", key: "col2", title: "Col2" },
60-
{ field: "col3", key: "col3", title: "Col3" },
61-
{ field: "col4", key: "col4", title: "Col4" },
62-
{ field: "col5", key: "col5", title: "Col5" },
63-
{ field: "col6", key: "col6", title: "Col6" },
57+
{ field: "col1", key: "col1", title: "Col1", width: 220 },
58+
{ field: "col2", key: "col2", title: "Col2", width: 220 },
59+
{ field: "col3", key: "col3", title: "Col3", width: 220 },
60+
{ field: "col4", key: "col4", title: "Col4", width: 220 },
61+
{ field: "col5", key: "col5", title: "Col5", width: 220 },
62+
{ field: "col6", key: "col6", title: "Col6", width: 220 },
63+
{ field: "col7", key: "col7", title: "Col7" },
64+
{ field: "col8", key: "col8", title: "Col8" },
6465
],
6566
columnResizeInfo: {
6667
column: "",
@@ -74,11 +75,11 @@
7475
methods: {
7576
initTableData() {
7677
let data = [];
77-
for (let i = 0; i < 8; i++) {
78+
for (let i = 0; i < 5; i++) {
7879
data.push({
7980
rowKey: i,
8081
col1: `A${i + 1}`,
81-
col2: `B${i + 1}`,
82+
col2: Mock.Random.sentence(3, 12),
8283
col3: `C${i + 1}`,
8384
col4: `D${i + 1}`,
8485
col5: `E${i + 1}`,
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
:::tip
22
1、当存在大文本时,列宽调整将会很有用<br>
33
2、通过`columnWidthResizeOption`设置列宽拖动功能<br>
4-
3、建议设置`scroll-width=0`,那么列宽拖动将会改变表格宽度
4+
3、建议设置`scroll-width=0`,那么当列宽总和大于容器宽度时,将会出横向滚动条<br>
5+
4、通过`column.width` 设置列的默认宽度,如果所有列宽总和小于容器宽度,列宽度将会自适应
56
:::

0 commit comments

Comments
 (0)