Fixed
- For
(item, index, group) in items
,index
andgroup
weren't being made available to elements inside anx-for
<template>
tag. Now they are #208
<div x-data="{ items: ['foo'] }">
<template x-for="(item, index) in items">
<div>
<h1 x-text="items.indexOf(item)"></h1>
// Same as...
<h2 x-text="index"></h2>
</div>
</template>
</div>
- Using
x-for
andx-if
in conjunction (<template x-for="..." x-if="...">
) resulted in odd behavior. It is now fully possible and supported #208
<div x-data="{ items: ['foo', 'bar'], show: false }">
<button @click="show = ! show"></button>
<template x-if="show" x-for="item in items">
<span x-text="item"></span>
</template>
</div>