ion-item-option
item option 组件是滑动项目的按钮。它必须放置在 item options 内部。ionSwipe 事件和 expandable 属性可以结合使用,为项目创建完整的滑动操作。
更多信息请参阅 item sliding 文档。
Properties
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 |
disabled
| 说明 | If true, the user cannot interact with the item option. |
| 属性 | disabled |
| 类型 | boolean |
| 默认值 | false |
download
| 说明 | This attribute instructs browsers to download a URL instead of navigating to it, so the user will be prompted to save it as a local file. If the attribute has a value, it is used as the pre-filled file name in the Save prompt (the user can still change the file name if they want). |
| 属性 | download |
| 类型 | string | undefined |
| 默认值 | undefined |
expandable
| 说明 | If true, the option will expand to take up the available width and cover any other options. |
| 属性 | expandable |
| 类型 | boolean |
| 默认值 | false |
href
| 说明 | Contains a URL or a URL fragment that the hyperlink points to. If this property is set, an anchor tag will be rendered. |
| 属性 | href |
| 类型 | string | undefined |
| 默认值 | undefined |
mode
| 说明 | The mode determines which platform styles to use. 这是一个虚拟属性,在初始化时设置一次,之后更改其值不会 更新组件。 |
| 属性 | mode |
| 类型 | "ios" | "md" |
| 默认值 | undefined |
rel
| 说明 | Specifies the relationship of the target object to the link object. The value is a space-separated list of link types. |
| 属性 | rel |
| 类型 | string | undefined |
| 默认值 | undefined |
target
| 说明 | Specifies where to display the linked URL. Only applies when an href is provided. Special keywords: "_blank", "_self", "_parent", "_top". |
| 属性 | target |
| 类型 | string | undefined |
| 默认值 | undefined |
type
| 说明 | The type of the button. |
| 属性 | type |
| 类型 | "button" | "reset" | "submit" |
| 默认值 | 'button' |
Events
该组件没有可用的事件。
Methods
该组件没有可用的公共方法。
CSS Shadow Parts
| Name | 说明 |
|---|---|
container | The container element that wraps the start, icon-only, default, and end slots. |
inner | The inner wrapper element that arranges the option content. |
native | The native HTML button or anchor element that wraps all child elements. |
CSS Custom Properties
- iOS
- MD
| Name | 说明 |
|---|---|
--background | Background of the item option |
--color | Color of the item option |
| Name | 说明 |
|---|---|
--background | Background of the item option |
--color | Color of the item option |
Slots
| Name | 说明 |
|---|---|
| Content is placed between the named slots if provided without a slot. | |
bottom | Content is placed below the option text. |
end | Content is placed to the right of the option text in LTR, and to the left in RTL. |
icon-only | Should be used on an icon in an option that has no text. |
start | Content is placed to the left of the option text in LTR, and to the right in RTL. |
top | Content is placed above the option text. |