跳到正文

SecureField

隐藏输入内容的原生编辑器,受控约定与 TextField 相同。

#导入

从 @quickgui/solid/swift-ui 导入 SecureField。

import { Host, SecureField } from "@quickgui/solid/swift-ui";

#用法

<Host matchContents={{ vertical: true }} style={{ width: 280 }}>
  <SecureField
    value={password()}
    placeholder="Password"
    onValueChange={setPassword}
  />
</Host>

#API 参考

展开条目查看说明和完整签名。短横线表示声明中未记录默认值。

SecureField

查看源码
SecureField(props: TextFieldProps): NativeNode
testIDstring—

Stable identifier exposed to macOS accessibility and UI testing.

string
查看源码
modifiersViewModifier[]—

SwiftUI modifiers, applied in array order.

ViewModifier[]
查看源码
valuestring—

Controlled field value.

string
查看源码
placeholderstring—

Declares placeholder (optional). Reactive JSX expressions update this property in place.

string
查看源码
onValueChange(value: string, event: QuickGuiEvent) => void—

Declares onValueChange (optional). Reactive JSX expressions update this property in place.

(value: string, event: QuickGuiEvent) => void
查看源码
onSubmit(event: QuickGuiEvent) => void—

Declares onSubmit (optional). Reactive JSX expressions update this property in place.

(event: QuickGuiEvent) => void
查看源码
ref((node: NativeNode) => void) | NativeNode—

Declares ref (optional). Reactive JSX expressions update this property in place.

((node: NativeNode) => void) | NativeNode
查看源码