In the vue doc : When toRef is used with component props, the usual restrictions around…
- User
In the vue doc : When toRef is used with component props, the usual restrictions around mutating the props still apply
So it means I can't modify values from a instance class that is passed in a props ?
Assistant
That's correct. When you pass a value as a prop to a Vue component, that value becomes reactive. This means Vue is watching it for changes, and will update the DOM if it changes.
However, you should treat props as read-only in the component that receives them. This means you should not directly modify the prop value.
For example, this is bad:
props: { foo: String } // Don't do this - modifies the prop directly this.foo = 'bar'Instead, if you want to modify the prop value in some way, you should:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.