跳到主要内容
版本:v7

ion-label

scoped

Label 元素主要用于为 Item 组件添加文本内容。在指定可见标签时,Label 也可用于表单控件组件(如 InputRadio)内部,但这并非强制要求。

标签在项目内部的位置可以是内联、固定、堆叠或浮动。

基本用法

项目标签

主题定制

颜色

属性

color

DescriptionThe 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
Type"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string | undefined
Defaultundefined

mode

DescriptionThe mode determines which platform styles to use.

This is a virtual property that is set once during initialization and will not update if you change its value after the initial render.
Attributemode
Type"ios" | "md"
Defaultundefined

position

DescriptionThe position determines where and how the label behaves inside an item.
Attributeposition
Type"fixed" | "floating" | "stacked" | undefined
Defaultundefined

事件

No events available for this component.

方法

No public methods available for this component.

CSS 影子组件

No CSS shadow parts available for this component.

CSS 自定义属性

NameDescription
--colorColor of the label. This property is only available when using ion-label inside of an ion-item.

插槽

No slots available for this component.