跳到主要内容
版本:v6

ion-label

scoped

标签(Label)是主要用于向项目(Item)组件添加文本内容的元素。在指定可见标签时,标签也可以在表单控件组件(如输入(Input)单选按钮(Radio))内部使用,但这不是必需的。

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

基本用法

项目标签

主题

颜色

属性

color

说明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.
属性color
类型"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string | undefined
默认值undefined

mode

说明The mode determines which platform styles to use.

这是一个虚拟属性,在初始化时设置一次,之后更改其值不会更新组件。
属性mode
类型"ios" | "md"
默认值undefined

position

说明The position determines where and how the label behaves inside an item.
属性position
类型"fixed" | "floating" | "stacked" | undefined
默认值undefined

事件

该组件没有可用的事件。

方法

该组件没有可用的公共方法。

CSS 阴影部分

该组件没有可用的 CSS 阴影部分。

CSS 自定义属性

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

插槽

该组件没有可用的插槽。