how to make property as reactive #6806
Replies: 2 comments 1 reply
-
You can use like this:But I dont't suggest to use like this. The best way is child component emit event to change the props in the parent component. |
Beta Was this translation helpful? Give feedback.
-
if wrapper it as a reactive object, change this proxy's prop value will effect DOM, but what I need is change the plain object: pass it to component: then set item.visible=false if define MenuItem as type: {visible?: Ref} if use Ref and init it before use, it woks but not friendly to end user |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a object type is MenuItem and it has property like
visible:boolean
when I use it in template
because this prop is not reactive, sow how can I do? (assume that I can't change type of it)
Beta Was this translation helpful? Give feedback.
All reactions