-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(discussion): Add example for 342
- Loading branch information
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
r""" | ||
https://v2.vuetifyjs.com/en/components/tooltips/ | ||
<v-tooltip bottom> | ||
<template v-slot:activator="{ on, attrs }"> | ||
<v-btn | ||
color="primary" | ||
dark | ||
v-bind="attrs" | ||
v-on="on" | ||
> | ||
Button | ||
</v-btn> | ||
</template> | ||
<span>Tooltip</span> | ||
</v-tooltip> | ||
""" | ||
|
||
from trame.app import get_server | ||
from trame.ui.vuetify2 import VAppLayout | ||
from trame.widgets import vuetify2, html | ||
|
||
server = get_server() | ||
server.client_type = "vue2" | ||
|
||
with VAppLayout(server): | ||
with vuetify2.VTooltip(bottom=True): | ||
with vuetify2.Template(v_slot_activator="{ on, attrs }"): | ||
vuetify2.VBtn( | ||
"Hover over me", | ||
v_bind="attrs", | ||
v_on="on", | ||
) | ||
html.Span("Tooltip") | ||
|
||
server.start(port=10002) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
r""" | ||
https://vuetifyjs.com/en/components/tooltips/ | ||
<v-tooltip text="Tooltip"> | ||
<template v-slot:activator="{ props }"> | ||
<v-btn v-bind="props">Hover over me</v-btn> | ||
</template> | ||
</v-tooltip> | ||
""" | ||
|
||
from trame.app import get_server | ||
from trame.ui.vuetify3 import VAppLayout | ||
from trame.widgets import vuetify3 | ||
|
||
server = get_server() | ||
server.client_type = "vue3" | ||
|
||
with VAppLayout(server): | ||
with vuetify3.VTooltip(text="Tooltip"): | ||
with vuetify3.Template(v_slot_activator="{ props }"): | ||
vuetify3.VBtn("Hover over me", v_bind="props") | ||
|
||
server.start(port=10003) |