Created
August 2, 2019 09:13
-
-
Save harrybeckwith/c9e7f9ee4fbbe98b275bfc6ea952f18e to your computer and use it in GitHub Desktop.
v-for vue template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<div | |
v-for="(item, i ) in items" | |
:key="i" | |
:class="{ active: i === activeItem}" | |
> | |
// some looped items from data here | |
// button for active toggle | |
<button @click="selectItem(i)"> make item active </button> | |
</div> | |
</div> | |
</template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment