← Back

vue/no-unused-vars warning

Disallow unused variable definitions of v-for directives or scope attributes

Examples

❌  Incorrect

<template>
    <ol>
        <!-- "i" is defined but never used. -->
        <li v-for="i in 5">item</li>
    </ol>
</template>

✅  Correct

<template>
    <ol>
        <!-- "i" is defined and used. -->
        <li v-for="i in 5">{{ i }}</li>
    </ol>
</template>