2019-05-08 15:39:27 +08:00

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>
);
}
});