-
Notifications
You must be signed in to change notification settings - Fork 21
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
Image component and optional context values #104
Comments
Sorry, to hear. I hope, I can help. Do you want to use the UI component 'image' or the HTML element 'image'? and Do you use TemplateValue or without? |
Hi :) yes I'm using a TemplateValue. I just noticed that HTLMKitComponents.Image(source:) its just a wrapper around HTMLKit.Image().source(TemplateValue.rawValue) and I tried both but I'm not sure why the src property is empty when displaying the page :( |
Btw, not sure it makes a difference here but I'm using Linux |
I'm using this hack to repackage the value until we can find a solution
but then I found another issue. The HTMLKitComponents Image type doesn't seem to have access to any of the HTMLKit methods like .style, .class, .height This seems to be the case with other components too |
I am currently at work. I will look into it tonight, when I am at home. |
If you want to use the HTML element 'image', then you should use just Image(). The component 'image' comes from the UI component library I am working on. That you able to use it, tells me, that you running against the main branch. If you do so, be aware that you might use implementations, wich could be work in progress and not meant for release yet. I am currently working on an update of the documentation. The documentation will explain and extend the thought of the UI component library. |
Makes no difference :-) |
All the UI components come with a predefined CSS. Overriding the style is a discussion worth. I haven't thought about it. So if you use the components library, do you use the CSS file too? How did you get to manage it? I haven't released instructions yet :-) |
Oh I'm using the deprecated Components repo, I saw that you moved it inside the HTMLKit library but I wanted to avoid targeting 'main' so I can keep a stable version.
Yes I'm using the css files :) and I agree that having a fixed style instead of being able to call '.style' would be closer to SwiftUI and preferable. |
Ah, that's sharp! Didn't suspect someone will use the component library. But am happy, someone do. If you miss something (similar or in comparison to SwiftUI), feel free to open an issue. |
Ups, sorry. Wrong button. |
Just an update :)
will cause a bug where the page will not update the content after the database/backend is updated. I assume its because the page is cached and the .dynamic uses the keyPath to get the new data. |
I want to let you know, that I remove the context management. You won't have this issue anymore. You can read more about in #118. You can already use the 3.0.0-alpha.1 release, if you like. But keep in mind its still alpha. |
Hi, love the library, but I'm having an extremely hard time trying to display an image using an url that comes from an optional field from the model
These are some scenarios that I'm facing
I had to create a computed var to try to drill down the model and fetch the url or default to "" and still doesn't work
If I try to use the whole path I get these scenarios
And if I try to get fancy
The text was updated successfully, but these errors were encountered: