跳到正文

Gauge

原生 SwiftUI 仪表,支持线性和圆形附属样式。

#导入

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

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

#用法

<Host matchContents>
  <Gauge
    value={storageUsed()}
    min={0}
    max={100}
    label="Storage"
    currentValueLabel={String(storageUsed()) + "%"}
    style="accessoryCircularCapacity"
  />
</Host>

#API 参考

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

Gauge(props: GaugeProps): NativeNode
testIDstring—

Stable identifier exposed to macOS accessibility and UI testing.

string
查看源码
modifiersViewModifier[]—

SwiftUI modifiers, applied in array order.

ViewModifier[]
查看源码
valuenumber—

Declares value. Reactive JSX expressions update this property in place.

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
查看源码
labelstring—

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

string
查看源码
currentValueLabelstring—

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

string
查看源码
minimumValueLabelstring—

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

string
查看源码
maximumValueLabelstring—

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

string
查看源码
styleGaugeStyle—

Layout, typography, paint, and interaction-state styles. Arrays merge left to right.

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

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

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