span

The <span> child component of <text> is used as a text modifier.

Permission List

None

Child Component

The <span> child component is supported.

Attribute

Name

Type

Default Value

Mandatory

Description

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.

data

string

-

No

Attribute set for a component to facilitate data storage and reading.

Event

Not supported

Style

Name

Type

Default Value

Mandatory

Description

color

<color>

-

No

Font color of the modified text.

font-size

<length>

30px

No

Font size of the modified text.

allow-scale

boolean

true

No

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

NOTE:

If the config-changes tag of fontSize is configured for abilities in the config.json file, the setting takes effect without application restart.

font-style

string

normal

No

Font style of the modified text. For details, see font-style of the text component.

font-weight

number | string

normal

No

Font weight of the modified text. For details, see font-weight of the text component.

text-decoration

string

none

No

Text decoration of the modified text. For details, see text-decoration of the text component.

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 that exists in the system or the font specified by Custom Font Styles in the family is selected as the font for the text.