-
I'm testing the following code: from trame.app import get_server
from trame.ui.vuetify3 import SinglePageLayout
from trame.widgets import vuetify3 as vuetify
server = get_server(client_type="vue3")
state, ctrl = server.state, server.controller
with SinglePageLayout(server) as layout:
with layout.content:
with vuetify.VContainer(
fluid=True,
classes="d-flex justify-center align-center",
style="height: 100%;",
):
with vuetify.VCard(style="max-width: 400px;"):
vuetify.VCardTitle("Centered Card")
with vuetify.VCardText():
vuetify.VTextField(
v_model=("text_value", ""),
label="Some text",
placeholder="Type here...",
variant="outlined"
)
server.start() The issue is that the default font-weight for VCardTitle is set to 500, but it isn’t visibly applied. I only notice a change when I adjust the font-weight to 550. Any insights on what might be causing this discrepancy? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
Additionally, with the following code I am unable to figure out why the from trame.app import get_server
from trame.ui.vuetify3 import SinglePageLayout
from trame.widgets import vuetify3 as vuetify
server = get_server(client_type="vue3")
state, ctrl = server.state, server.controller
with SinglePageLayout(server) as layout:
with layout.content:
with vuetify.VContainer(
fluid=True,
classes="d-flex justify-center align-center",
style="height: 100%;",
):
with vuetify.VCard(width=500):
with vuetify.VCardTitle("Centered Card"):
vuetify.VSpacer()
vuetify.VBtn(icon="mdi-refresh", density="compact")
vuetify.VDivider()
with vuetify.VCardText():
vuetify.VTextField(
v_model=("text_value", ""),
label="Some text",
placeholder="Type here...",
variant="outlined"
)
server.start() |
Beta Was this translation helpful? Give feedback.
-
You may want to use https://play.vuetifyjs.com/ to explore and test your vuetify code |
Beta Was this translation helpful? Give feedback.
-
The issue seems to be related to the fonts not being loaded/available. You can fix that by adding a style entry server.enable_module({
"styles":["https://fonts.googleapis.com/css?family=Roboto:300,400,500"]
}) |
Beta Was this translation helpful? Give feedback.
-
Hi @jourdain, I hope this is another question that you can answer simply. The following code worked for me in from trame.app import get_server
from trame.ui.vuetify3 import SinglePageLayout
from trame.widgets import html, vuetify3 as vuetify
server = get_server(client_type="vue3")
state, ctrl = server.state, server.controller
state.upload = None
with SinglePageLayout(server) as layout:
with layout.content:
with vuetify.VContainer(fluid=True, classes="pa-4"):
with vuetify.VFileInput(
v_model=("upload",),
style="display: none;",
ref="upload_file",
):
pass
with html.Div(style="position: relative;"):
vuetify.VBtn(
"Upload",
click="$refs.upload_file.$refs.input.click()",
)
if __name__ == "__main__":
server.start() I am receiving |
Beta Was this translation helpful? Give feedback.
The issue seems to be related to the fonts not being loaded/available. You can fix that by adding a style entry