Vue · VUE0024

Prefer true attribute shorthand

Prefer native boolean attributes over v-bind expressions that only pass true.
VUE0024vite-doctor/vuetemplateinfoSuggestion

Run this rule

pnpm vite-doctor . --framework vue --rules vue/template/prefer-true-attribute-shorthand

Why it matters

Native boolean attributes are true by presence, so binding a literal true adds template noise without changing behavior.

Use the bare native attribute, such as disabled, instead of ="true".

Example

Use native boolean shorthand

Before

<template>
  <button :disabled="true">Save</button>
</template>

After

<template>
  <button disabled>Save</button>
</template>
Copyright © 2026