Skip to content

v-for with named slot (via v-for index) skips first item for 0-based indices #5480

Closed
@rask

Description

@rask

Version

2.2.6

Reproduction link

https://codepen.io/Rask/pen/GmZedP

Steps to reproduce

See Codepen. Create a component with a slot repeated over v-for and named with the index, then render the slot elements in the parent component using matching indices. Set the index to be 0..n integers (i.e. a non-associative array).

What is expected?

All elements that are rendered with v-for and slot index should be rendered properly from the parent component data.

What is actually happening?

The very first element defined with v-for is somehow skipped when rendering.


I'm building a modular repeater field where you can add and remove items which are synced via basic events. The items are slotted in via item indices which are in sync by setting the slot index inside the custom component when rendered inside the parent.

Can this be related to 0-based indices or something? When I replace the slot name with :name="'item' index" the rendering works as expected.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions