Procházet zdrojové kódy

add example for using local images

Falko Schindler před 1 rokem
rodič
revize
a17476ccd9

+ 7 - 1
website/more_documentation/image_documentation.py

@@ -10,10 +10,16 @@ def main_demo() -> None:
 def more() -> None:
     ui.add_body_html('<script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script>')
 
+    @text_demo('Local files', '''
+        You can use local images as well by passing a path to the image file.
+    ''')
+    def local():
+        ui.image('website/static/logo.png').classes('w-16')
+
     @text_demo('Lottie files', '''
         You can also use [Lottie files](https://lottiefiles.com/) with animations.
     ''')
-    async def lottie():
+    def lottie():
         # ui.add_body_html('<script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script>')
 
         src = 'https://assets1.lottiefiles.com/datafiles/HN7OcWNnoqje6iXIiZdWzKxvLIbfeCGTmvXmEm1h/data.json'