My component vue like this :
<template>
<div>
<ul class="list-inline list-photo">
<template v-for="item in items">
<li>
<a href="javascript:;" class="thumbnail thumbnail-upload"
:title="trans('store.add.img.button')" @click="addPhoto">
<span class="fa fa-plus fa-2x"></span>
</a>
</li>
</template>
</ul>
</div>
</template>
<script>
export default {
data() {
return {
items: [1, 2, 3, 4, 5]
}
},
methods: {
addPhoto() {
// change element clicked
}
}
}
</script>
If the link in tag li clicked, I want to replace the element li to be like this :
<li>
<div class="thumbnail">
<img src="https://myshop.co.id/img/no-image.jpg" alt="">
<a href="javascript:;" class="thumbnail-check"><span class="fa fa-check-circle"></span></a>
</div>
</li>
So if I click the second element li, the it will replace the seconde element li
How can I do it?