Explorar o código

more input doc

Rodja Trappe %!s(int64=4) %!d(string=hai) anos
pai
achega
86e99ca813
Modificáronse 2 ficheiros con 5 adicións e 4 borrados
  1. 2 4
      api_reference.py
  2. 3 0
      nicegui/elements/input.py

+ 2 - 4
api_reference.py

@@ -40,7 +40,5 @@ with open('README.md', 'r') as file:
 
 describe(ui.input)
 with example():
-    ui.input(label='Text', on_change=lambda e: result.set_text(e.value))
-    ui.number(label='Number', format='%.2f', on_change=lambda e: result.set_text(e.value))
-
-    result = ui.label('result', typography='bold')
+    ui.input(label='Text', placeholder='a placeholder', on_change=lambda e: result.set_text('you typed: ' + e.value))
+    result = ui.label('', typography='bold')

+ 3 - 0
nicegui/elements/input.py

@@ -15,6 +15,9 @@ class Input(StringElement):
 
         :param str label: display name for the text input
         :param str placeholder: text to show if no value is entered
+        :param str value: the current value of the field
+        :param str design: Quasar props to alter the appearance (see `their reference <https://quasar.dev/vue-components/input>`_)
+        :param Callable on_change: callback when the input is confirmed via leaving the focus
         """
         view = jp.QInput(
             label=label,