返回介绍

Ionic4 浮动按钮组件 ion-fab-button

发布于 2019-11-22 18:04:16 字数 7301 浏览 1377 评论 0 收藏 0

Ionic4 项目中我们可以使用 Ionic4 浮动按钮组件 ion-fab-button 对项目进行布局。

ion-fab-button 官方文档地址:https://ionicframework.com/docs/api/fab-button

Floating Action Buttons (FABs) represent the primary action in an application. By default, they have a circular shape. When pressed, the button may open more related actions. As the name suggests, FABs generally float over the content in a fixed position. This is not achieved exclusively by using an <ion-fab-button>FAB</ion-fab-button> . They need to be wrapped with an <ion-fab> component in order to be fixed over the content.

If the FAB button is not wrapped with <ion-fab> , it will scroll with the content. FAB buttons have a default size, a mini size and can accept different colors:

ion-fab-button 用法 Usage

<ion-fab>
  <ion-fab-button>
    <ion-icon name="add"></ion-icon>
  </ion-fab-button>
</ion-fab>

ion-fab-button 属性 Properties

activated

Description

If true , the fab button will be show a close icon.

Attributeactivated
Typeboolean
Defaultfalse

color

Description

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 .

Attributecolor
Typestring | undefined

disabled

Description

If true , the user cannot interact with the fab button.

Attributedisabled
Typeboolean
Defaultfalse

href

Description

Contains a URL or a URL fragment that the hyperlink points to. If this property is set, an anchor tag will be rendered.

Attributehref
Typestring | undefined

mode

Description

The mode determines which platform styles to use.

Attributemode
Type"ios" | "md"

routerDirection

Description

When using a router, it specifies the transition direction when navigating to another page using href .

Attributerouter-direction
Type"back" | "forward" | "root"
Default'forward'

show

Description

If true , the fab button will show when in a fab-list.

Attributeshow
Typeboolean
Defaultfalse

size

Description

The size of the button. Set this to small in order to have a mini fab.

Attributesize
Type"small" | undefined

translucent

Description

If true , the fab button will be translucent.

Attributetranslucent
Typeboolean
Defaultfalse

type

Description

The type of the button.

Attributetype
Type"button" | "reset" | "submit"
Default'button'

ion-fab-button 事件 Events

NameDescription
ionBlurEmitted when the button loses focus.
ionFocusEmitted when the button has focus.

ion-fab-button 中的 CSS 自定义属性

NameDescription
--backgroundBackground of the button
--background-activatedBackground of the button when activated
--background-focusedBackground of the button when focused
--border-colorBorder color of the button
--border-radiusBorder radius of the button
--border-styleBorder style of the button
--border-widthBorder width of the button
--box-shadowBox shadow of the button
--colorText color of the button
--color-activatedText color of the button when activated
--color-focusedText color of the button when focused
--padding-bottomPadding bottom of the button
--padding-endPadding end of the button
--padding-startPadding start of the button
--padding-topPadding top of the button
--ripple-colorColor of the button ripple effect
--transitionTransition of the button

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文