Skip to content

Commit

Permalink
docs(discussion): Add example for 342
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Sep 21, 2023
1 parent a337c85 commit 7df9327
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
36 changes: 36 additions & 0 deletions examples/validation/discussion/342_vuetify2.py
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)
23 changes: 23 additions & 0 deletions examples/validation/discussion/342_vuetify3.py
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)

0 comments on commit 7df9327

Please sign in to comment.