Skip to content

Commit 7603eb7

Browse files
author
huangshuwei
committed
refine doc
1 parent 294de22 commit 7603eb7

File tree

13 files changed

+140
-72
lines changed

13 files changed

+140
-72
lines changed

examples/src/docs/en/ve-table/virtual-scroll/auto-height.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
enable: true,
2626
},
2727
columns: [
28+
{ field: "index", key: "a", title: "#", width: 100, align: "left" },
2829
{
2930
field: "name",
3031
key: "b",
@@ -48,21 +49,23 @@
4849
initData() {
4950
let data = [];
5051
for (let i = 0; i < 10000; i++) {
51-
let value = i;
52+
let value = "";
5253
if (i % 2 === 0) {
5354
const rowCount = this.getRandom(3, 5);
5455
5556
for (let i = 0; i < rowCount; i++) {
5657
value += `this is the long word.<br />`;
5758
}
59+
} else {
60+
value = `name${i}`;
5861
}
5962
6063
data.push({
6164
rowKey: i,
65+
index: i,
6266
name: value,
63-
date: i,
64-
hobby: i,
65-
address: i,
67+
hobby: `hobby${i}`,
68+
address: `address${i}`,
6669
});
6770
}
6871

examples/src/docs/en/ve-table/virtual-scroll/base.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
enable: true,
2525
},
2626
columns: [
27+
{ field: "index", key: "a", title: "#", width: 100, align: "left" },
2728
{ field: "name", key: "b", title: "Name", width: 200, align: "left" },
2829
{ field: "hobby", key: "c", title: "Hobby", width: 300, align: "left" },
2930
{ field: "address", key: "d", title: "Address", width: "", align: "left" },
@@ -37,10 +38,10 @@
3738
for (let i = 0; i < 10000; i++) {
3839
data.push({
3940
rowKey: i,
40-
name: i,
41-
date: i,
42-
hobby: i,
43-
address: i,
41+
index: i,
42+
name: `name${i}`,
43+
hobby: `hobby${i}`,
44+
address: `address${i}`,
4445
});
4546
}
4647

examples/src/docs/en/ve-table/virtual-scroll/row-checkbox.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
// type=checkbox
4444
type: "checkbox",
4545
title: "",
46-
width: 50,
46+
width: 100,
4747
align: "center",
4848
},
4949
{
@@ -68,10 +68,9 @@
6868
for (let i = 0; i < 10000; i++) {
6969
data.push({
7070
rowKey: i,
71-
name: i,
72-
date: i,
73-
hobby: i,
74-
address: i,
71+
name: `name${i}`,
72+
hobby: `hobby${i}`,
73+
address: `address${i}`,
7574
});
7675
}
7776

examples/src/docs/en/ve-table/virtual-scroll/row-expand.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,9 @@
6868
for (let i = 0; i < 10000; i++) {
6969
data.push({
7070
rowKey: i,
71-
name: i,
72-
date: i,
73-
hobby: i,
74-
address: i,
71+
name: `name${i}`,
72+
hobby: `hobby${i}`,
73+
address: `address${i}`,
7574
});
7675
}
7776

examples/src/docs/en/ve-table/virtual-scroll/row-radio.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,9 @@
6464
for (let i = 0; i < 10000; i++) {
6565
data.push({
6666
rowKey: i,
67-
name: i,
68-
date: i,
69-
hobby: i,
70-
address: i,
67+
name: `name${i}`,
68+
hobby: `hobby${i}`,
69+
address: `address${i}`,
7170
});
7271
}
7372

examples/src/docs/zh/ve-table/footer-summary/virtual-scroll.md

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
virtualScrollOption: {
2626
// 是否开启
2727
enable: true,
28-
scrolling: this.scrolling,
2928
},
3029
3130
columns: [
@@ -35,7 +34,6 @@
3534
title: "Name",
3635
width: 200,
3736
align: "left",
38-
renderBodyCell: this.renderRowIndex,
3937
},
4038
{ field: "hobby", key: "c", title: "Hobby", width: 300, align: "left" },
4139
{ field: "address", key: "d", title: "Address", width: "", align: "left" },
@@ -44,40 +42,14 @@
4442
};
4543
},
4644
methods: {
47-
// virtual scrolling
48-
scrolling({
49-
scrollStartIndex,
50-
visibleStartIndex,
51-
visibleEndIndex,
52-
visibleAboveCount,
53-
visibleBelowCount,
54-
}) {
55-
this.scrollStartIndex = scrollStartIndex;
56-
console.log(
57-
scrollStartIndex,
58-
visibleStartIndex,
59-
visibleEndIndex,
60-
visibleAboveCount,
61-
visibleBelowCount
62-
);
63-
},
64-
renderRowIndex({ row, column, rowIndex }) {
65-
console.log(rowIndex);
66-
return (
67-
<span class="text-bold" style="color:#1890ff;">
68-
{rowIndex + this.scrollStartIndex + 1}
69-
</span>
70-
);
71-
},
7245
initData() {
7346
let data = [];
7447
for (let i = 0; i < 10000; i++) {
7548
data.push({
7649
rowKey: i,
77-
name: i,
78-
date: i,
79-
hobby: i,
80-
address: i,
50+
name: `name${i}`,
51+
hobby: `hobby${i}`,
52+
address: `address${i}`,
8153
});
8254
}
8355

examples/src/docs/zh/ve-table/virtual-scroll/auto-height.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
enable: true,
2626
},
2727
columns: [
28+
{ field: "index", key: "a", title: "#", width: 100, align: "left" },
2829
{
2930
field: "name",
3031
key: "b",
@@ -48,21 +49,23 @@
4849
initData() {
4950
let data = [];
5051
for (let i = 0; i < 10000; i++) {
51-
let value = i;
52+
let value = "";
5253
if (i % 2 === 0) {
5354
const rowCount = this.getRandom(3, 5);
5455
5556
for (let i = 0; i < rowCount; i++) {
5657
value += `this is the long word.<br />`;
5758
}
59+
} else {
60+
value = `name${i}`;
5861
}
5962
6063
data.push({
6164
rowKey: i,
65+
index: i,
6266
name: value,
63-
date: i,
64-
hobby: i,
65-
address: i,
67+
hobby: `hobby${i}`,
68+
address: `address${i}`,
6669
});
6770
}
6871

examples/src/docs/zh/ve-table/virtual-scroll/base.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
enable: true,
2525
},
2626
columns: [
27+
{ field: "index", key: "a", title: "#", width: 100, align: "left" },
2728
{ field: "name", key: "b", title: "Name", width: 200, align: "left" },
2829
{ field: "hobby", key: "c", title: "Hobby", width: 300, align: "left" },
2930
{ field: "address", key: "d", title: "Address", width: "", align: "left" },
@@ -37,10 +38,10 @@
3738
for (let i = 0; i < 10000; i++) {
3839
data.push({
3940
rowKey: i,
40-
name: i,
41-
date: i,
42-
hobby: i,
43-
address: i,
41+
index: i,
42+
name: `name${i}`,
43+
hobby: `hobby${i}`,
44+
address:`address${i}`,
4445
});
4546
}
4647

examples/src/docs/zh/ve-table/virtual-scroll/main.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<RowExpand />
1010
<ColumnFixed />
1111
<FooterSummary />
12+
<!-- <RowIndex /> -->
1213
<API title="API" anchor="API" desc="virtualScrollOption 虚拟滚动配置" />
1314
</div>
1415
</template>
@@ -21,6 +22,7 @@ import RowRadio from "./row-radio.md";
2122
import RowExpand from "./row-expand.md";
2223
import FooterSummary from "../footer-summary/virtual-scroll.md";
2324
import ColumnFixed from "./column-fixed.md";
25+
/* import RowIndex from "./row-index.md"; */
2426
import API from "../api/virtual-scroll-option-props";
2527
2628
export default {
@@ -34,6 +36,7 @@ export default {
3436
RowExpand,
3537
ColumnFixed,
3638
FooterSummary,
39+
/* RowIndex, */
3740
API
3841
}
3942
};

examples/src/docs/zh/ve-table/virtual-scroll/row-checkbox.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,9 @@
6868
for (let i = 0; i < 10000; i++) {
6969
data.push({
7070
rowKey: i,
71-
name: i,
72-
date: i,
73-
hobby: i,
74-
address: i,
71+
name: `name${i}`,
72+
hobby: `hobby${i}`,
73+
address: `address${i}`,
7574
});
7675
}
7776

0 commit comments

Comments
 (0)