JS.VUE.NO.MULTIPLE.OBJECTS.IN.CLASS

Disallow to pass multiple objects into array to class

Rule Details

This rule disallows to pass multiple objects into array to class.

{'vue/no-multiple-objects-in-class': ['error']}

Copy
<template>
  <div>
    <!-- GOOD -->
    <div :class="[{'foo': isFoo, 'bar': isBar}]" />

    <!-- BAD -->
    <div :class="[{'foo': isFoo}, {'bar': isBar}]" />
  </div>
</template>

Options

Nothing.

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/