Explorar o código

add demo for multi-select

Rodja Trappe %!s(int64=2) %!d(string=hai) anos
pai
achega
0e1d04ae6e
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      website/more_documentation/select_documentation.py

+ 10 - 0
website/more_documentation/select_documentation.py

@@ -25,3 +25,13 @@ def more() -> None:
         ]
         ui.select(options=continents, with_input=True,
                   on_change=lambda e: ui.notify(e.value)).classes('w-40')
+
+    @text_demo('Multi selection', '''
+        You can activate `multiple` to allow the selection of more than one item.
+    ''')
+    def multi_select():
+        names = ['Alice', 'Bob', 'Carol']
+        ui.select(names, multiple=True, label='comma-separated') \
+            .classes('w-64')
+        ui.select(names, multiple=True, label='with chips') \
+            .props('use-chips').classes('w-64')