Skip to content

Commit 5322e0d

Browse files
committed
add scrollTo method
1 parent 3402ecc commit 5322e0d

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

packages/ve-table/src/index.jsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ import {
44
clsName,
55
getNotFixedTotalWidthByColumnKey,
66
} from "./util";
7-
import { getValByUnit, isFunction, isNumber } from "../../src/utils/index.js";
7+
import {
8+
getValByUnit,
9+
isFunction,
10+
isNumber,
11+
scrollTo,
12+
} from "../../src/utils/index.js";
813
import emitter from "../../src/mixins/emitter";
914
import {
1015
COMPS_NAME,
@@ -1013,9 +1018,9 @@ export default {
10131018
}
10141019
},
10151020

1016-
// table scroll
1017-
[TABLE_METHODS.SCROLL](options) {
1018-
this.$refs[this.tableContainerRef].scroll(options);
1021+
// table scrollTo
1022+
[TABLE_METHODS.SCROLL_TO](option) {
1023+
scrollTo(this.$refs[this.tableContainerRef], option);
10191024
},
10201025
},
10211026
mounted() {

packages/ve-table/src/util/constant.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,5 @@ export const COMPS_CUSTOM_ATTRS = {
8686

8787
// table methods
8888
export const TABLE_METHODS = {
89-
SCROLL: "scroll",
89+
SCROLL_TO: "scrollTo",
9090
};

0 commit comments

Comments
 (0)