diff --git a/src/index-bar/index.js b/src/index-bar/index.js index 1d757851a..56ca725bb 100644 --- a/src/index-bar/index.js +++ b/src/index-bar/index.js @@ -152,6 +152,20 @@ export default createComponent({ }, render(h) { + const Indexes = this.indexList.map(index => { + const active = index === this.activeAnchorIndex; + + return ( + + {index} + + ); + }); + return (
- {this.indexList.map(index => ( - - {index} - - ))} + {Indexes}
{this.slots('default')}
diff --git a/src/index-bar/test/__snapshots__/index.spec.js.snap b/src/index-bar/test/__snapshots__/index.spec.js.snap index d18f1cdea..a186b4f79 100644 --- a/src/index-bar/test/__snapshots__/index.spec.js.snap +++ b/src/index-bar/test/__snapshots__/index.spec.js.snap @@ -32,7 +32,7 @@ exports[`scroll and update active anchor 1`] = ` exports[`scroll and update active anchor 2`] = `
-
ABCDEFGHIJKLMNOPQRSTUVWXYZ
+
ABCDEFGHIJKLMNOPQRSTUVWXYZ
1