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
Remove prototype elements when data is present #55
Comments
Interesting! I may steal this for Pakyow 😁 We have something called view versions that this would fit right into. For example: <div data-prop="foo" data-version="default" class="foo">First</div>
<div data-prop="foo" data-version="alt" class="fooalt">First</div>
<div data-version="proto" class="fooproto">First</div> When running in prototype mode, all versions are presented. Outside of that, |
I think there would be less surprise for users of ratchet if you just had multiple props of the same name and have merged data overwrite everything, rather than have a more explicit tool for specifying prototype data I would rather have everything that is inside a data-prop to be by default considered prototype that can be overwritten by merged in data. |
Seems like a good idea @dgmcguire. Glad you like the idea @bryanp 😊 |
Hmm maybe I misunderstood the purpose of this feature. In Pakyow, the |
The use case I'm trying to address is sometimes a prototype view needs multiple example elements to really drive the point of it home. I suppose the canonical example might be an actual list. If the |
Yep, got it. In Pakyow, this is a non-issue. When you look for a prop by name, it returns an object that represents every matching view prop at that level. Then, the data presentation method handles removing them (essentially making the view look like the data). I believe this is what @dgmcguire is getting at as well. So, looks like I misunderstood 😬 |
Would like to be able to designate certain elements as prototype. This would allow multiple versions of a thing to be shown in prototype, but exclude it in the final render.
For example,
When rendered with no data, the prototype would be included. However when rendered with data, it would look like:
The text was updated successfully, but these errors were encountered: