跳到正文

Stepper

受控的原生数字步进器,数值范围可限制。

#导入

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

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

#用法

<Host matchContents>
  <Stepper
    value={copies()}
    min={1}
    max={20}
    label={"Copies: " + copies()}
    onValueChange={setCopies}
  />
</Host>

#API 参考

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

Stepper(props: StepperProps): NativeNode
testIDstring—

Stable identifier exposed to macOS accessibility and UI testing.

string
查看源码
modifiersViewModifier[]—

SwiftUI modifiers, applied in array order.

ViewModifier[]
查看源码
valuenumber—

Controlled stepper value.

number
查看源码
minnumber—

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

number
查看源码
maxnumber—

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

number
查看源码
stepnumber—

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

number
查看源码
labelstring—

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

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

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

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

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

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