-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Allow for setting of the attributes directly instead of using props keyword in the component #17
Comments
Tried it out and it's working but it gives a warning when providing an attribute that is not specifically defined. code: https://github.com/woutdp/live_svelte/tree/nicer-prop-passing If we can make the warning disappear somehow we can add it. |
This is exactly what I've been asking you regarding props. Just saw this. This will be very useful enhancement. |
I think this issue is useful, but also wanted to mention a third way of defining props. What if you could do something like this in the mount:
And then the prop number would be automatically picked up since we know that's what we want to pass
Actually we can probably even get away with the following:
And make sure it's automatically picked up, but then we'd have to deprecate the previous way I think. One thing is that let's say you have 2 Svelte components in one LiveView, you might only want to pass certain things to one of them and certain things to the other, don't know if it's really an issue though Something to think about |
That is better. I think the sigil will become the preferred method so whatever works with that will be my go to. |
Will be closed by: #50 |
Current:
New:
We can probably use
@rest
for this. We should still allowprops
as that can be a way to add keywords that are taken such as theclass
andname
keyword (or even theprops
keyword, which is very meta)The text was updated successfully, but these errors were encountered: