1๐
โ
If I understand your question correctly, you want to use Slots.
In item-component you need to put in:
<slot></slot>
exactly where you want the value of i to be.
-1๐
If you want to use i
in scripts, just add property in item-component
, for example named no
and put it in for:
<div class="layout">
<item-component v-for="i in 10" :key="i" :no="i" ></item-component>
</div>
Source:stackexchange.com