跳到主要内容
版本:v7

ion-buttons

scoped

Buttons 组件是一个容器元素。它应在 toolbar 内部使用,可以包含多种类型的按钮,包括标准 buttonmenu buttonback button

基本用法

按钮位置

按钮可以使用命名插槽在工具栏内定位。下图描述了每个插槽的说明。

Slot描述
start在 LTR 中定位到内容的左侧,在 RTL 中定位到右侧
end在 LTR 中定位到内容的右侧,在 RTL 中定位到左侧
secondaryios 模式下将元素定位到内容的左侧,在 md 模式下直接定位到右侧
primaryios 模式下将元素定位到内容的右侧,在 md 模式下定位到最右侧

按钮类型

工具栏中的按钮默认样式为透明,但可以通过按钮上的 fill 属性更改。此示例中包含的 back buttonmenu button 属性仅用于展示目的;请参阅各自文档了解正确用法。

可折叠按钮

可以在按钮上设置 collapse 属性,使其在头部折叠时折叠。这通常与可折叠大标题一起使用。

信息

此功能仅适用于 iOS。

属性

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

事件

该组件没有可用的事件。

方法

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

CSS 阴影部分

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

CSS 自定义属性

该组件没有可用的 CSS 自定义属性。

插槽

该组件没有可用的插槽。