返回介绍

Ionic4 进度指示组件 ion-progress-bar

发布于 2019-11-22 18:04:18 字数 4830 浏览 1248 评论 0 收藏 0

Ionic4项目中我们可以使用Ionic4进度指示组件ion-progress-bar对项目进行布局。

ion-progress-bar官方文档地址:https://ionicframework.com/docs/api/progress-bar

ion-progress-bar is a horizontal progress bar to visualize the progression of an operation and activity. You can choose between two types: determinate and indeterminate.

Progress Type

Determinate

If the percentage of an operation is known, you should use the determinate type. This is the default type and the progress is represented by the value property.

A buffer shows circles as animation to indicate some activity. If the buffer property is smaller than 1 you can show the addditional buffering progress.

Indeterminate

If an operation is in progress and it's not necessary to indicate how long it will take.

If you add reversed="true", you receive a query which is used to indicate pre-loading.

ion-progress-bar 用法(Usage)














</ion-progress-bar>
import React from 'react';

import { IonProgressBar } from '@ionic/react';

const Example: React.SFC = () => (
  
    {/*-- Default Progressbar --*/}
    

    {/*-- Default Progressbar with 50 percent --*/}
    

    {/*-- Colorize Progressbar --*/}
    
    

    {/*-- Other types --*/}
    
    
    
  
);

export default Example;

ion-progress-bar 属性(Properties)

buffer

Description

If the buffer and value are smaller than 1, the buffer circles will show. The buffer should be between [0, 1].

Attributebuffer
Typenumber
Default1

color

Description

The color to use from your application's color palette. Default options are: "primary", "secondary", "tertiary", "success", "warning", "danger", "light", "medium", and "dark". For more information on colors, see theming.

Attributecolor
Typestring | undefined

mode

Description

The mode determines which platform styles to use.

Attributemode
Type"ios" | "md"

reversed

Description

If true, reverse the progress bar direction.

Attributereversed
Typeboolean
Defaultfalse

type

Description

The state of the progress bar, based on if the time the process takes is known or not. Default options are: "determinate" (no animation), "indeterminate" (animate from left to right).

Attributetype
Type"determinate" | "indeterminate"
Default'determinate'

value

Description

The value determines how much of the active bar should display when the type is "determinate". The value should be between [0, 1].

Attributevalue
Typenumber
Default0

ion-progress-bar中的CSS 自定义属性

NameDescription
--backgroundSame as --buffer-background when using a determinate progress bar, otherwise it styles the background of the ion-progress-bar itself.
--buffer-backgroundColor of the buffer bar
--progress-backgroundColor of the progress bar

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文