-
Notifications
You must be signed in to change notification settings - Fork 295
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
Use a string binding for a dynamic class attribute? #145
Comments
@RohanTalip Seems like it's working. I just checked with Text component and it's working fine. Can you verify the same with a different component? |
|
This is working for me now. I probably had a typo somewhere. Sorry for the trouble. |
I've been having trouble with this, specifically for view components. Not able to get it to work! |
OK Seems my problem was that class can only be set to a single class, not a string of multiple classes. Seems like a limitation, and I don't see why it can't concatenate the computed styles together. ie:
Also seems that I cannot split/share class definitions, either, ie:
The above will actually only apply the second reference to class1, and totally ignore the style defined in the first reference. |
@tmaly1980, multiple classes in the class attribute work for me. Splitting of class definitions (as you explained it above) doesn't work for me, but so far that hasn't been a problem. |
@RohanTalip Can you provide an example? |
@tmaly1980, done, in issue #173 . |
In my Vue.js 2.6.10 web app, I can write something (contrived) like this to use a string as the value to bind to the class attribute of an element:
(Assume that imageUrl is valid.)
However in Vue Native, the dynamic binding of a string to the imageClass computed property doesn't appear to work:
(Assume that imageSource is valid, and that the imageClasses computed property and styles are unchanged from above.)
Something like this, with a static class, works in Vue Native:
I can also use an object to dynamically bind to the class attribute in Vue Native:
However, is it possible to dynamically bind a string to the class attribute?
I'm wondering if there are some commits in Vue.js that are missing in Vue Native ... ? (For example, that were added in Vue.js after code from react-vue was copied into vue-native-core.)
The text was updated successfully, but these errors were encountered: