Modify object property passed as a prop

  Kiến thức lập trình

In my parent component, I have a ref:

const person = ref({ name: 'John Doe', parent: { name: 'Jane Doe' } })

In my child component, I recieve the entire object:

<parent-picker :person="person" />

Is it ok to alter the person’s “parent” property inside child-component, or does it fall under the prop modification anti-pattern?

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT