Vue · VUE0027

Do not mutate props

Flags writes to props, including deep writes to objects the parent passed in.
VUE0027vite-doctor/vuepropserrorNo fix

Run this rule

pnpm vite-doctor . --framework vue --rules vue/props/no-mutating-props

Why it matters

Props belong to the parent. Vue rejects a direct write such as props.count++ in development, and in production the parent's next render overwrites it. A deep write such as props.user.name = 'x' silently changes the parent's object.

Emit an event or use defineModel() so the parent applies the change, or copy the prop into local state when the child needs its own editable value.

Example

Let the parent own prop updates

Before

<script setup lang="ts">
const props = defineProps<{ user: { name: string } }>()
function rename(name: string) {
  props.user.name = name
}
</script>

After

<script setup lang="ts">
const props = defineProps<{ user: { name: string } }>()
const emit = defineEmits<{ rename: [name: string] }>()
function rename(name: string) {
  emit('rename', name)
}
</script>
Copyright © 2026