ion-buttons
Buttons 组件是一个容器元素。它应使用在工具栏内部,可以包含多种类型的按钮,包括标准按钮、菜单按钮和返回按钮。
基本用法
按钮放置
按钮可以使用命名插槽放置在工具栏内部。下表描述了每个插槽。
| 插槽 | 描述 |
|---|---|
start | 在 LTR 中定位到内容的 左侧,在 RTL 中定位到 右侧。 |
end | 在 LTR 中定位到内容的 右侧,在 RTL 中定位到 左侧。 |
secondary | 在 ios 模式下定位到内容的 左侧,在 md 模式下直接定位到 右侧。 |
primary | 在 ios 模式下定位到内容的 右侧,在 md 模式下定位到最 右侧。 |
按钮类型
工具栏中的按钮默认样式为透明,但这可以通过按钮上的 fill 属性更改。本示例中返回按钮和菜单按钮上包含的属性仅用于展示目的;请参阅各自的文档以了解正确用法。
可折叠按钮
可以在按钮上设置 collapse 属性,使其在头部折叠时一并折叠。这通常与可折叠大标题一起使用。
信息
此功能仅适用于 iOS。
Properties
collapse
| 说明 | If true, buttons will disappear when its parent toolbar has fully collapsed if the toolbar is not the first toolbar. If the toolbar is the first toolbar, the buttons will be hidden and will only be shown once all toolbars have fully collapsed. Only applies in ios mode with collapse set to true on ion-header.Typically used for Collapsible Large Titles |
| 属性 | collapse |
| 类型 | boolean |
| 默认值 | false |
Events
该组件没有可用的事件。
Methods
该组件没有可用的公共方法。
CSS Shadow Parts
该组件没有可用的 CSS 阴影部分。
CSS Custom Properties
该组件没有可用的 CSS 自定义属性。
Slots
该组件没有可用的插槽。