Download Progress
带实时说明文字和可选取消操作的进度条。
可用框架
Angular: 可用 Vue: 可用 React: 可用 React Native: 暂不可用
用法
<div class="demo-stack" style="max-width: 26rem">
@if (cancelled()) {
<div class="demo-row">
<span style="color: var(--text-secondary)">Download cancelled.</span>
<button soneBtn type="button" size="sm" variant="outline" (click)="cancelled.set(false)">Retry</button>
</div>
} @else {
<sone-download-progress
[frac]="0.42"
cancellable
ariaLabel="Example model download"
(cancelRequested)="cancelled.set(true)"
/>
}
<sone-download-progress [frac]="null" label="Preparing…" ariaLabel="Preparing files" />
<sone-download-progress label="Example-3B" separator=" · " [frac]="0.63" ariaLabel="Example-3B download" />
<sone-download-progress size="md" [frac]="0.7" ariaLabel="Setup progress" />
</div>导入
import {
SoneDownloadProgressComponent,
} from "@surface-one/angular/download-progress";API 参考
SoneDownloadProgressComponent组件
| 名称 | 类型 | 默认值 |
|---|---|---|
frac | number | null | null |
label | — | $localize`Downloading…` |
separator | string | " " |
ariaLabel | string | null | null |
size | SoneProgressSize | "sm" |
cancellable | boolean | false |
cancelLabel | — | $localize`Cancel download` |
| 名称 | 类型 |
|---|---|
cancelRequested | void |