feat(IndexBar): add change event (#7296)

* feat(IndexBar): add change event

* docs(IndexBar): update event param
This commit is contained in:
neverland
2020-10-08 18:56:21 +08:00
committed by GitHub
parent abcb2dc8df
commit c13b953cff
5 changed files with 64 additions and 13 deletions
+7
View File
@@ -87,6 +87,12 @@ export default createComponent({
indexList() {
this.$nextTick(this.onScroll);
},
activeAnchorIndex(value) {
if (value) {
this.$emit('change', value);
}
},
},
methods: {
@@ -201,6 +207,7 @@ export default createComponent({
const match = this.children.filter(
(item) => String(item.index) === index
);
if (match[0]) {
match[0].scrollIntoView();