Suppose I have the following SFC component:
<script setup lang="ts">
export interface Person {
name: string;
}
const props = defineProps<{
person: Person;
}>();
function onClick(): void {
props.person.name = 'Joe'; // mutate nested field
}
</script>
<template>
<button @click="onClick">Click</button>
</template>
How can I prevent the mutation of the nested prop field?