1 Star 0 Fork 5.1K

youguilin / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
stepper-item.md 131.50 KB
一键复制 编辑 原始数据 按行查看 历史
mamingshuai 提交于 2021-06-02 01:00 . update OpenHarmony 2.0 Canary

stepper-item

The <stepper-item> component displays a step in the step navigator. This component is the child component of <stepper>.

NOTE: This component is supported since API version 5.

Permission List

None

Child Component

Supported

Attribute

Name

Type

Default Value

Mandatory

Description

label

Label

-

No

Button text at the bottom of the customized step navigator. Dynamic modification is not supported. If this attribute is not set, BACK and NEXT will be used by default as button text in case the system language is not Chinese. For the first step, there is no previous button. For the last step, the text on the next button is START for non-Chinese languages by default.

id

string

-

No

Unique ID of a component.

style

string

-

No

Style declaration of a component.

class

string

-

No

Style class of a component, which is used to refer to a style table.

ref

string

-

No

Used to register reference information of child elements or child components. The reference information is registered with the parent component on $refs.

disabled

boolean

false

No

Whether the component is disabled. If it is disabled, it cannot respond to user interaction.

data

string

-

No

Attribute set for components to facilitate data storage and reading.

Table 1 Label parameters

Name

Type

Default Value

Description

prevLabel

string

-

Text content of the previous button at the bottom of the step navigator.

nextLabel

string

-

Text content of the next button at the bottom of the step navigator.

status

string

normal

Initial status of the current step in the step navigator. Available values are as follows:

  1. normal: The right button is displayed normally and can navigate users to the next step when it is clicked.
  2. disabled: The right button is grayed out and unavailable.
  3. waiting: The right button is not displayed, and a process bar is displayed instead.

Style

Name

Type

Default Value

Mandatory

Description

color

<color>

#e600000

No

Text color.

font-size

<length>

16px

No

Text size.

allow-scale

boolean

true

No

Whether the text size changes with the system's font size settings.

font-style

string

normal

No

Text font style. Available values are as follows:

  1. normal: standard font style
  2. italic: italic font style

font-weight

number|string

normal

No

Text font weight. The number value must be an exact multiple of 100 ranging from 100 to 900. The default value is 400. A larger value indicates a bigger weight. Available values of the string type are lighter, normal, bold, or bolder.

text-decoration

string

none

No

Text modifier. Available values are as follows:

  1. underline: An underline is used.
  2. line-through: A strikethrough is used.
  3. none: The standard text is used.

font-family

string

sans-serif

No

Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the font specified by Custom Font Styles is used for the text.

padding

<length>

0

No

The attribute can have one to four values:
  • If you set only one value, it specifies the padding for four sides.

  • If you set two values, the first value specifies the top and bottom padding, and the second value specifies the left and right padding.

  • If you set three values, the first value specifies the top padding, the second value specifies the left and right padding, and the third value specifies the bottom padding.

  • If you set four values, they respectively specify the padding for top, right, bottom, and left sides (in clockwise order).

padding-[left|top|right|bottom]

<length>

0

No

Left, top, right, and bottom padding (in px).

padding-[start|end]

<length>

0

No

Start and end padding.

margin

<length>

0

No

Shorthand attribute to set margins for all sides in a declaration. The attribute can have one to four values:

  • If you set only one value, it specifies the margin for all the four sides.

  • If you set two values, the first value is for the top and bottom sides and the second value for the left and right sides.

  • If you set three values, the first value is for the top, the second value for the left and right, and the third value for the bottom.

  • If you set four values, they are margins for top, right, bottom, and left sides, respectively.

margin-[left|top|right|bottom]

<length>

0

No

Left, top, right, and bottom margins.

margin-[start|end]

<length>

0

No

Start and end margins.

border

-

0

No

Shorthand attribute to set all borders. You can set border-width, border-style, and border-color in sequence. Default values are used for attributes that are not set.

border-style

string

solid

No

Shorthand attribute to set the style for all borders. Available values are as follows:

  • dotted: Dotted border. The radius of a dot is half of border-width.
  • dashed: Dashed border
  • solid: Solid border

border-[left|top|right|bottom]-style

string

solid

No

Styles of the left, top, right, and bottom borders. The available values are dotted, dashed, and solid.

border-[left|top|right|bottom]

-

-

No

Shorthand attribute to set the borders for every side respectively. You can set border-width, border-style, and border-color in sequence. Default values are used for attributes that are not set.

border-width

<length>

0

No

Shorthand attribute to set the width of all borders, or separately set the width of each border.

border-[left|top|right|bottom]-width

<length>

0

No

Attribute to set widths of left, top, right, and bottom borders.

border-color

<color>

black

No

Shorthand attribute to set the color of all borders, or separately set the color of each border.

border-[left|top|right|bottom]-color

<color>

black

No

Attribute to set colors of left, top, right, and bottom borders.

border-radius

<length>

-

No

Attribute to set the radius of round borders of an element. This attribute cannot be used to set the width or color of a specific border. To set the width or color, you need to set border-width or border-color for all the borders at the same time.

border-[top|bottom]-[left|right]-radius

<length>

-

No

Attribute to receptively set the radii of upper-left, upper-right, lower-right, and lower-left rounded corners

background

<linear-gradient>

-

No

This attribute supports Gradient Styles only but is not compatible with background-color or background-image.

background-color

<color>

-

No

Background color.

background-image

string

-

No

Background image. Currently, this attribute is not compatible with background-color or background. Both Internet and local image resources are supported.

background-size

  • string
  • <length> <length>
  • <percentage> <percentage>

auto

No

Background image size.

  • The string values are as follows:
    • contain: Expands the image to the maximum size so that the height and width of the image are applicable to the content area.
    • cover: Extends the background image to a large enough size so that the background image completely covers the background area. Some parts of the image may not be displayed in the background localization area.
    • auto: The original image width-height ratio is retained.
  • The two <length> values are as follows:

    Width and height of the background image. The first value indicates the width, and the second value indicates the height. If you only set one value, the other value is set to auto by default.

  • The two <percentage> values are as follows:

    Width and height of the background image in percentage of the parent element. The first value indicates the width, and the second value indicates the height. If you only set one value, the other value is set to auto by default.

background-repeat

string

repeat

No

Repeating attribute of a background image. By default, a background image is repeated both horizontally and vertically.

  • repeat: Draws images along the x-axis and y-axis at the same time.
  • repeat-x: Draws images along the x-axis.
  • repeat-y: Draws images along the y-axis.
  • no-repeat: The image is not drawn repeatedly.

background-position

  • string string
  • <length> <length>
  • <percentage> <percentage>

0px 0px

No

  • Using keywords: If only one keyword is specified, the other value is center by default. The two values define the horizontal position and vertical position, respectively.
    • left: leftmost in the horizontal direction
    • right: rightmost in the horizontal direction
    • top: top in the vertical direction
    • bottom: bottom in the vertical direction
    • center: center position
  • Using <length>: The first value indicates the horizontal position, and the second value indicates the vertical position. 0 0 indicates the upper left corner. The unit is pixel. If only one value is specified, the other one is 50%.
  • Using <percentage>: The first value indicates the horizontal position, and the second value indicates the vertical position. 0% 0% indicates the upper left corner. 100% 100% indicates the lower right corner. If only one value is specified, the other one is 50%.
  • Using both <percentage> and <length>.

opacity

number

1

No

Transparency of an element. The value ranges from 0 to 1. The value 1 means opaque, and 0 means completely transparent.

display

string

flex

No

How and whether to display the box containing an element. Available values are as follows:

  • flex: flexible layout
  • none: The element is hidden.

visibility

string

visible

No

Whether to display an element. Invisible borders occupy layout space. (To remove the borders, set the display attribute to none.) Available values are as follows:

  • visible: The element is visible.
  • hidden: The element is hidden but still takes up space.
NOTE:

If both visibility and display are set, only display takes effect.

NOTE: The <stepper-item> component does not support height and width styles. The width of each item is the same as that of its container. The height of each item is the difference between the container height and the bottom button height.

Event

Name

Parameter

Triggered when

appear

-

Triggered when this step is displayed.

disappear

-

Triggered when this step disappears.

touchstart

TouchEvent

The tapping starts

touchmove

TouchEvent

The tapping moves

touchcancel

TouchEvent

The tapping is interrupted

touchend

TouchEvent

The tapping ends

click

-

A component is clicked

longpress

-

A component is long pressed

swipe5+

SwipeEvent

A user quickly swipes on a component.

1
https://gitee.com/yougl/docs.git
git@gitee.com:yougl/docs.git
yougl
docs
docs
master

搜索帮助