vuetify in trame

How do I convert tooltip in vuetify to trame language



This way of writing of mine is problematic, when I run the program, the button disappears, how can I fix it?

The outer <template> should be ignored.

You should look at the reference information in the course material

Otherwise, it should be as follow

with vuetify.VTooltip(left=True):
   with vuetify.Template(v_slot_activator="{ on, attrs }"):
     vuetify.VBtn(
       "Left", 
       color="primary", 
       dark=True, 
       v_bind="attrs", 
       v_on="on",
     )
   html.Span("Left tooltip")

Also to validate what you wrote in Python match the expected Vue template, you can take any instance of that template and print it like so.

with vuetify.VTooltip(left=True) as is_valid:
   with vuetify.Template(v_slot_activator="{ on, attrs }"):
     vuetify.VBtn("Left", color="primary", dark=True, v_bind="attrs", v_on="on")
   html.Span("Left tooltip")

   print(is_valid.html)

Thanks, the course material is exactly what I need! :grinning:

1 Like