JS.VUE.V.FOR.DELIMITER.STYLE

Enforce 'v-for' directive's delimiter style

Rule Details

This rule enforces which delimiter (in or of) should be used in v-for directives.

{'vue/v-for-delimiter-style': ['error']}

Copy
<template>
  <!-- GOOD -->
  <div v-for="x in xs" />

  <!-- BAD -->
  <div v-for="x of xs" />
</template>

Options

Default is set to in.

Copy
{
  "vue/v-for-delimiter-style": ["error", "in" | "of"]
}
  • "in" (default) ... requires using in.
  • "of" ... requires using of.

"of"

{'vue/v-for-delimiter-style': ['error', 'of']}

Copy
<template>
  <!-- GOOD -->
  <div v-for="x of xs" />

  <!-- BAD -->
  <div v-for="x in xs" />
</template>

Further Reading

  • Guide - List Rendering (https://v3.vuejs.org/guide/list.html)

The content on this page is adapted from the ESLint User Guide. Copyright © OpenJS Foundation and other contributors, www.openjsf.org. All rights reserved. https://eslint.org/docs/rules/