I am encountering an issue with using index in a v-for loop to implement a function that deletes items from an array. The linter is flagging "index is defined but never used" as an error.
I am following the instructions provided in a tutorial, but I am unsure of the correct placement for the index variable.
<template>
<div class="row">
<app-quote v-for="(quote,index) in quotes" :key="quote.id" @click.native="deleteQuote(index)">{{ quote }}</app-quote>
</div>
</template>
<script>
import Quote from './Quote.vue';
export default {
props: ['quotes'],
components: {
appQuote: Quote
},
methods: {
deleteQuote(index) {
this.$emit('quoteDeleted', index);
}
},
}
</script>