[Vuejs]-How to do conditional rendering on dynamic props

0๐Ÿ‘

โœ…

v-for also supports an optional second argument for the index of the
current item. โ€” vue docs

<CardItem
    v-for="(address, index) in addresses.slice(1)"
    :key="uniqueKey('address', address)"
    :cta="index !== 0 ? cms.page.cta : null" // remove cta from the first address only
/>

Leave a comment