changed callback to be async
This commit is contained in:
@@ -14,7 +14,7 @@ async def main_page():
|
||||
# Example 1: Multiple files with content
|
||||
uploaded_files = ui.column().classes('w-full mt-4')
|
||||
|
||||
def handle_multiple_files(file: FileData):
|
||||
async def handle_multiple_files(file: FileData):
|
||||
with uploaded_files:
|
||||
with ui.card().classes('p-2 mb-2'):
|
||||
ui.label(f"📄 {file['name']}").classes('font-medium')
|
||||
@@ -26,7 +26,7 @@ async def main_page():
|
||||
on_upload=handle_multiple_files,
|
||||
multiple=True,
|
||||
accept='.pdf,.docx,.txt,.jpg,.png',
|
||||
max_size=5 # 5MB limit
|
||||
max_size=15 # 5MB limit
|
||||
).classes('w-full max-w-xl mx-auto')
|
||||
|
||||
ui.separator().classes('my-8')
|
||||
@@ -72,7 +72,7 @@ async def main_page():
|
||||
# Example 4: Image drop with preview
|
||||
image_preview = ui.column().classes('w-full mt-4')
|
||||
|
||||
def handle_image(img: ImageData):
|
||||
async def handle_image(img: ImageData):
|
||||
print(f"Image uploaded: {img['image'].format}, Size: {img['size']}")
|
||||
image_preview.clear()
|
||||
with image_preview:
|
||||
|
||||
Reference in New Issue
Block a user