-
-
Notifications
You must be signed in to change notification settings - Fork 489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ui.image will never load local image in single page app example #3223
Comments
the main.py file is insdie single_page_app. actually I use an absolute path/web image will also have this problem. I will upload a screenshot later |
yes, check this video @python-and-fiction 2024-06-15.16-08-10.mp4 @router.add('/')
def show_one():
ui.image('https://github.com/zauberzeug/nicegui/blob/main/website/static/logo_square.png?raw=true')
@router.add('/two')
def show_two():
# my local path
ui.image(r'C:\Users\atticus\Desktop\ToDoList-nicegui\single_page_app\logo_square.png')
@router.add('/three')
def show_three():
# your solution
ui.image('single_page_app/logo_square.png') |
@falkoschindler hi falkoschindler, do you have any idea on this problem? |
same as #2011 |
add statics file seem not work for me, but adding all reroute with |
Hi @atticus-lv, This is very confusing, but I think I understand what is happening: As a workaround, you can limit the route to non-path strings (i.e. strings not containing a slash I'll close this issue, because it isn't really a bug but a limitation of our small "single page app" example. |
Description
system: win11
nicegui: 1.4.27
code from https://github.com/zauberzeug/nicegui/tree/main/examples/single_page_app/
only modify the
show_two
in single page app examplemain.py
like this, and local image will never be loaded2024-06-15.00-54-27.mp4
The text was updated successfully, but these errors were encountered: