Replies: 2 comments
-
|
Hi @HametAl , from trame.app import get_server
from trame.widgets import vuetify3
server = get_server()
state = server.state
ctrl = server.controller
state.mouse_move_on = False
def toggle_mouse_move(self):
state.mouse_move_on = not self.state.mouse_move_on
print(state.mouse_move_on)
@ctrl.trigger("test")
def on_mouse_move(self, *args, **kwargs):
print(args)
print(kwargs)
vuetify3.VBtn("toggle mouse move", click=toggle_mouse_move)
with vuetify3.VContainer(
fluid=True,
classes="pa-0 fill-height",
mousemove="mouse_move_on && trigger('test', [$event])",
):
# your UI ...
passWith, this code, not network bandwidth will be used to the callback on the trame server. HTH, |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Another option is to use another DOM element that always have the mousemove but you use a |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Jourdain
I want to activate mousemove event on Vcontainer dynamically. I am able to activate it statically using either of following codes:
Or
Or
def listener (event): event_result={} if event=="mousemove": event_result=(on_mouse_move, '[$event.offsetX]') return event_result VContainer (**listener("mousemove"))But is there any way to put the listener dynamically off and on? Or dynamically change from mousemove to click or any other events?
Thanks and regards
Beta Was this translation helpful? Give feedback.
All reactions