Przeglądaj źródła

integer added to documentation

groucho86 1 rok temu
rodzic
commit
aa533633c4

+ 7 - 0
website/more_documentation/number_documentation.py

@@ -17,3 +17,10 @@ def more() -> None:
     def clearable():
         i = ui.number(value=42).props('clearable')
         ui.label().bind_text_from(i, 'value')
+
+    @text_demo('Integer', '''
+       Coerce the returned value to be integer instead of the default float.    
+    ''')
+    def integer():
+        i = ui.number(value=38)
+        ui.button('Check number type', on_click=lambda: ui.notify(f'{i.value=} is of type {type(i.value)}'))