-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
v-bind="obj" seems to create a new object rather than passing the reference #7947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
Hi Evan, I had actually thought of destructuring but as I was trying to do renaming of the variables as like this "{ newVariable: oldVariable }" as stated on the MDN, it just didn't work so I thought of posting this issue... I'll do a reproduction and create a new issue if needed be. Thanks |
Destructuring with alias in |
I was confused with the reproduction earlier. Post above was updated. I'll try to create another reproduction for the other issue I am facing. Thanks |
Uh oh!
There was an error while loading. Please reload this page.
Version
2.5.16
Reproduction link
https://jsfiddle.net/742zcceg/1/
Steps to reproduce
What is expected?
In the template code which consumes the slot, when we use the slot-scope attribute, we get a plain Object. However we need the class structure to invoke functions, access getters, etc.
What is actually happening?
We can't access the class structure of the object that was bind as we're just getting a new Object instance rather than the reference.
This is related to #4529 which lets the slot bind to an object. The thing is, I would like to invoke the functions of the object's class that was passed over. With the current situation, it is not doable as it's creating a new Object instance instead of just referencing the object which was bind to the slot.
The text was updated successfully, but these errors were encountered: