瀏覽代碼

using ui.input params to make the field a password

Rodja Trappe 1 年之前
父節點
當前提交
acfe35ffff
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      examples/authentication/main.py

+ 1 - 1
examples/authentication/main.py

@@ -35,7 +35,7 @@ def login() -> None:
         return RedirectResponse('/')
     with ui.card().classes('absolute-center'):
         username = ui.input('Username').on('keydown.enter', try_login)
-        password = ui.input('Password').on('keydown.enter', try_login).props('type=password')
+        password = ui.input('Password', password=True, password_toggle_button=True).on('keydown.enter', try_login)
         ui.button('Log in', on_click=try_login)