Vue · VUE0023

Prefer 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.
VUE0023vite-doctor/vuetemplateinfoSuggestion

Run this rule

pnpm vite-doctor . --framework vue --rules vue/template/prefer-same-name-prop-shorthand

Why it matters

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

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>
Copyright © 2026