mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
feat: migrate IndexBar component
This commit is contained in:
parent
6c85294d35
commit
f956d1ab3b
@ -65,4 +65,6 @@ module.exports = [
|
|||||||
'swipe',
|
'swipe',
|
||||||
'swipe-item',
|
'swipe-item',
|
||||||
'image-preview',
|
'image-preview',
|
||||||
|
'index-bar',
|
||||||
|
'index-anchor',
|
||||||
];
|
];
|
||||||
|
@ -39,7 +39,9 @@ export default createComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.$nextTick(() => {
|
||||||
this.height = this.$el.offsetHeight;
|
this.height = this.$el.offsetHeight;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@ -57,7 +59,7 @@ export default createComponent({
|
|||||||
style={this.anchorStyle}
|
style={this.anchorStyle}
|
||||||
class={[bem({ sticky }), { [BORDER_BOTTOM]: sticky }]}
|
class={[bem({ sticky }), { [BORDER_BOTTOM]: sticky }]}
|
||||||
>
|
>
|
||||||
{this.slots('default') || this.index}
|
{this.$slots.default ? this.$slots.default() : this.index}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -58,6 +58,8 @@ export default createComponent({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
emits: ['select'],
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeAnchorIndex: null,
|
activeAnchorIndex: null,
|
||||||
@ -245,7 +247,7 @@ export default createComponent({
|
|||||||
>
|
>
|
||||||
{Indexes}
|
{Indexes}
|
||||||
</div>
|
</div>
|
||||||
{this.slots('default')}
|
{this.$slots.default?.()}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -290,10 +290,10 @@ module.exports = {
|
|||||||
path: 'grid',
|
path: 'grid',
|
||||||
title: 'Grid 宫格',
|
title: 'Grid 宫格',
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// path: 'index-bar',
|
path: 'index-bar',
|
||||||
// title: 'IndexBar 索引栏',
|
title: 'IndexBar 索引栏',
|
||||||
// },
|
},
|
||||||
{
|
{
|
||||||
path: 'nav-bar',
|
path: 'nav-bar',
|
||||||
title: 'NavBar 导航栏',
|
title: 'NavBar 导航栏',
|
||||||
@ -624,10 +624,10 @@ module.exports = {
|
|||||||
path: 'grid',
|
path: 'grid',
|
||||||
title: 'Grid',
|
title: 'Grid',
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// path: 'index-bar',
|
path: 'index-bar',
|
||||||
// title: 'IndexBar',
|
title: 'IndexBar',
|
||||||
// },
|
},
|
||||||
{
|
{
|
||||||
path: 'nav-bar',
|
path: 'nav-bar',
|
||||||
title: 'NavBar',
|
title: 'NavBar',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user