-
-
Notifications
You must be signed in to change notification settings - Fork 245
Cannot bind backgroundColor to a layout #229
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
This is a limitation due to the way ListViews work in NativeScript, the views defined in the template have to be created up-front before the list goes through the items and tries to render them. That is a bit problematic because we don't have the data required within the template, and to solve this ns-vue uses a deeply nested Proxy object - which returns a Proxy up to the maximum depth of 10: nativescript-vue/platform/nativescript/runtime/components/v-template.js Lines 103 to 108 in 93ea971
nativescript-vue/platform/nativescript/util/index.js Lines 99 to 116 in 93ea971
To avoid this, you unfortunately need to add a type check (or anything that prevents setting the |
I am interested to try if we can return nothing from the |
Thanks for the fast reply and workaround as always @rigor789—really appreciate it. Just to note the Angular plugin doesn’t have this same problem, so I’m wondering what was done there to handle the same situation. If you need any help on my end let me know. |
We are locking this issue because it has been closed for more than 14 days. If the issue comes up again please open a new issue with additional details. |
Version
1.3.1
Reproduction link
https://play.nativescript.org/?template=play-vue&id=L8tcfY&v=3
Platform and OS info
iOS 11, NativeScript 4.0.1
Steps to reproduce
Run https://play.nativescript.org/?template=play-vue&id=L8tcfY&v=3.
What is expected?
The page will render with a red box.
What is actually happening?
The app crashes with an NSInvalidArgument exception.
This one is messing with me. If you do
backgroundColor="red"
the example works, but if you bind to a string with"red"
it fails. I have no idea what’s going on, but any help would be appreciated. It’s possible that this affects more than just thebackgroundColor
property, but that’s what I hit.The text was updated successfully, but these errors were encountered: