Vue · Template

VUE0024Prefer true attribute shorthand

Prefer native boolean attributes over v-bind expressions that only pass true.

Why it happens

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

Fix

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>

Verify the fix

Run only this rule after editing so the report stays focused on the diagnostic you are closing:

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