Vue · VUE0027
Do not mutate props
Flags writes to props, including deep writes to objects the parent passed in.
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.
Recommended fix
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.
Useful links
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>