Skip to content

Files

Latest commit

 

History

History
42 lines (32 loc) · 774 Bytes

no-template-shadow.md

File metadata and controls

42 lines (32 loc) · 774 Bytes

Pattern: Use of shadowed variable in template

Issue: -

Description

This rule aims to eliminate shadowed variable declarations of v-for directives or scope attributes.

<template>
  <!-- ✓ GOOD -->
  <div v-for="i in 5"></div>
  <div v-for="j in 5"></div>

  <!-- ✗ BAD -->
  <div>
    <div v-for="k in 5">
      <div v-for="k in 10"></div>
      <div slot-scope="{ k }"></div>
    </div>
  </div>
  <div v-for="l in 5"></div>
</template>

<script>
  export default {
    data () {
      return {
        l: false
      }
    }
  }
</script>

Further Reading