feat(IndexBar): add change event (#7296)
* feat(IndexBar): add change event * docs(IndexBar): update event param
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user