-
Notifications
You must be signed in to change notification settings - Fork 146
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
Question about interactions between client and server and vue componenets executing JS code #838
Comments
Hi Jovan, another good question. However, I think that most of the questions are answered by #847 especially by the last example on the vue component howto. |
Thanks! That's very helpful. I am still not sure how the changes are propagated back to the server from the vue component though, i don't think there is an example in the documentation for that. But I think I did find an example from you somewhere ( i think it was the example of the local_storage access), and maybe that has a hint.. will analyze it more in depth when I have a chance! Thank you! Edit: Feel free to close this if you see fit (or when the associated docs PRs are merged, or whenever you thing appropriate) |
Hi again, Since I could not find an example of the following.. can maybe someone try to explain what I am doing wrong (or if what I am trying to do is possible). Basically, i have a vue component, and when I click a button I want some output to be synced to a solara reactive component. In this case, i would like a simple thing.. the component is a textbox and a button, so when the button is clicked, the value of the input field to be synced to a reactive variable. If this is possible, would be nice to have an explicit example on this. My apologies if this is covered in an example somewhere that i have missed |
Hey! The issue you're running into has to do with naming of the arguments - argument names like The easiest fix is therefore to change from calling Another option would be to make use of one of the other type of magic argument, |
Hi! Thank you @iisakkirotko ! This was exactly the explanation I was looking for! Thank you again! (feel free to close this issue when/if you see fit) |
Hi,
This might be a strange question/request but please bear with me..
I've found out that for some cases, having something executed by the front-end is "better" than on the server side. An example that comes to mind is, say your application needs to play a sounds. If you are gonna deploy this, it seems to me easier to write some JS code to play sound using the browser capabilities, than fight with device ports etc.. one is gonna do the sounds generation on the server side.
Solara allows this actually, with the
@component_vue
one can make a, say button that when pressed plays a sounds. An example of this is (kind of pseudo code)And the corresponding vue component will be something like
This kind of approach works fairly well and I am very happy that solara provides this functionality!
My problem is the following:
solara.Button()
way (so in python).solara.Button(on_click)
instead? Maybe somehow wrapped in python. That will allow for making solara.task that I find useful for things. And one can "wrap" it so that, some things can be executed on the server, and relevant stuff can be dispatched to the browser.@component_vue
could be made 2-directional with the python server.. i.e... you dispatch something to the frontend (clinet) a computation is done there, or some process or whatever, and the result can be sent back to the server for something else to be updated (like a state, or whatever needs to happen next).I hope at least some of these things make sense..
looking forward to some kind of answer / advice / or pointing in the right direction. Thank you!
The text was updated successfully, but these errors were encountered: