mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
27 lines
497 B
JavaScript
27 lines
497 B
JavaScript
import { use } from '../utils';
|
|
import { ChildrenMixin } from '../mixins/relation';
|
|
|
|
const [sfc, bem] = use('index-anchor');
|
|
|
|
export default sfc({
|
|
mixins: [ChildrenMixin('vanIndexBar', { indexKey: 'childrenIndex' })],
|
|
|
|
props: {
|
|
index: [String, Number]
|
|
},
|
|
|
|
methods: {
|
|
scrollIntoView() {
|
|
this.$el.scrollIntoView();
|
|
}
|
|
},
|
|
|
|
render(h) {
|
|
return (
|
|
<div class={bem()}>
|
|
{this.slots('default') ? this.slots('default') : this.index}
|
|
</div>
|
|
);
|
|
}
|
|
});
|