Vue · Template

VUE0023Prefer same-name prop shorthand

Prefer Vue 3.4 same-name v-bind shorthand when a prop and its bound variable have the same logical name.

Why it happens

Repeating the same prop name and variable name in templates adds noise without adding meaning.

Fix

Use or v-bind:prop only when the bound variable has the same logical name.

Example

Use same-name prop shorthand

Before

<template>
  <MyCmp :my-prop="myProp" />
</template>

After

<template>
  <MyCmp :my-prop />
</template>

Keep explicit bindings when names differ

Before

<template>
  <MyCmp :my-prop="myProp" />
</template>

After

<template>
  <MyCmp :my-prop="selectedValue" />
</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-same-name-prop-shorthand
Copyright © 2026