-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
data:x binding #966
Comments
I don't think it's a terrible idea, but we should document the overhead created when binding direct data to native HTML. If people thought this was standard practice, it could slow down large apps with heavy data attributes. |
This hasn't really come up again since I opened this issue, so I'm going to close it |
I just tried this, assuming it worked like My question is, how would I conditionally show the data attribute, in the case that I have a CSS selector checking for the existence of the data attribute ( This may be similar to... Data attribute without value is assigned the string |
The way that should be done - |
Just throwing an idea out there. I've run into a situation where it would be handy to attach data to DOM nodes:
The
<Scroller>
component has a scroll handler that determines which<section>
element currently spans the middle of the window, and setsindex
accordingly.It would be convenient to be able to attach data to the
<section>
elements:My idea is that a
data:x
binding would simply add adata
property to the node in question:It might be a terrible idea, and there are certainly other ways to achieve the same end result. (A
data-color
attribute isn't one of them though — data attributes can only contain strings, limiting their usefulness.) But perhaps other people have encountered similar needs?The text was updated successfully, but these errors were encountered: