mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(SkuRow): incorrect image line wrap (#6626)
This commit is contained in:
parent
7a70440ee1
commit
3bc27215ea
@ -70,14 +70,20 @@ export default createComponent({
|
||||
const nodes = this.slots();
|
||||
|
||||
if (this.item.largeImageMode) {
|
||||
const middle = Math.ceil(nodes.length / 2);
|
||||
const top = [];
|
||||
const bottom = [];
|
||||
|
||||
nodes.forEach((node, index) => {
|
||||
const group = Math.floor(index / 3) % 2 === 0 ? top : bottom;
|
||||
group.push(node);
|
||||
});
|
||||
|
||||
return (
|
||||
<div class={bem('scroller')} ref="scroller">
|
||||
<div class={bem('row')} ref="row">
|
||||
{nodes.slice(0, middle)}
|
||||
{top}
|
||||
</div>
|
||||
<div class={bem('row')}>{nodes.slice(middle, nodes.length)}</div>
|
||||
{bottom.length && <div class={bem('row')}>{bottom}</div>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user