A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/vuejs/vue/issues/5480 below:

`v-for` with named `slot` (via `v-for` index) skips first item for 0-based indices · Issue #5480 · vuejs/vue · GitHub

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.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4