Comments (6)
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
from nicegui.
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')
from nicegui.
@falkoschindler hi falkoschindler, do you have any idea on this problem?
from nicegui.
same as #2011
Follow this
#2035 (comment)
from nicegui.
add statics file seem not work for me, but adding all reroute with ui.page
works
from nicegui.
Hi @atticus-lv,
This is very confusing, but I think I understand what is happening:
The @ui.page('/{_:path}')
decorator creates an endpoint that matches all routes including static images paths. But since the router can't serve images, the image isn't displayed.
As a workaround, you can limit the route to non-path strings (i.e. strings not containing a slash /
): @ui.page('/{_}')
.
I'll close this issue, because it isn't really a bug but a limitation of our small "single page app" example.
A much more powerful API is in the making: PR #2811.
from nicegui.
Related Issues (20)
- how can i upload a directory use ui.upload component HOT 2
- container.clear silently deletes timers created in event handlers HOT 2
- Unable to update table object from function HOT 3
- Changing min/max limits of `ui.range` breaks the element HOT 2
- Bug in props parsing HOT 7
- User Storage Intercommunication Across Devices on Non-Standard Ports HOT 2
- Bus error crash on aarch64 - Caused by orjson HOT 1
- Storage_secret missing with ui.run_with and on_connect HOT 2
- Frameless Window Options Break When Compiled into EXE with ui.page HOT 1
- Clearing value of `ui.editor` does not work on 2nd try
- On the expectations of refreshable + user storage HOT 1
- nicegui-pack issure on windows: No module named 'typing_extensions' HOT 1
- Using chatai, enter the question carriage return did not respond HOT 2
- Client has been deleted but is still being used. This is most likely a bug in your application code HOT 4
- Dark mode switch `ui.expansion()` color to white
- ui.download N times when you open N tabs HOT 3
- Nice GUI table elements with buttons don't stick when organizing table
- please delete
- When calling props('color=None') (or white), class text-white is added HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nicegui.