返回介绍

Ionic4 日期组件 ion-picker

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

Ionic4 项目中我们可以使用 Ionic4 日期组件 ion-picker 对项目进行布局。

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

A Picker is a dialog that displays a row of buttons and columns underneath. It appears on top of the app's content, and at the bottom of the viewport.

ion-picker 属性 Properties

animated

Description

If true , the picker will animate.

Attributeanimated
Typeboolean
Defaulttrue

backdropDismiss

Description

If true , the picker will be dismissed when the backdrop is clicked.

Attributebackdrop-dismiss
Typeboolean
Defaulttrue

buttons

Description

Array of buttons to be displayed at the top of the picker.

TypePickerButton[]
Default[]

columns

Description

Array of columns to be displayed in the picker.

TypePickerColumn[]
Default[]

cssClass

Description

Additional classes to apply for custom CSS. If multiple classes are provided they should be separated by spaces.

Attributecss-class
Typestring | string[] | undefined

duration

Description

Number of milliseconds to wait before dismissing the picker.

Attributeduration
Typenumber
Default0

enterAnimation

Description

Animation to use when the picker is presented.

Type((Animation: Animation, baseEl: any, opts?: any) => Promise<Animation>) | undefined

keyboardClose

Description

If true , the keyboard will be automatically dismissed when the overlay is presented.

Attributekeyboard-close
Typeboolean
Defaulttrue

leaveAnimation

Description

Animation to use when the picker is dismissed.

Type((Animation: Animation, baseEl: any, opts?: any) => Promise<Animation>) | undefined

mode

Description

The mode determines which platform styles to use.

Attributemode
Type"ios" | "md"

showBackdrop

Description

If true , a backdrop will be displayed behind the picker.

Attributeshow-backdrop
Typeboolean
Defaulttrue

ion-picker 事件 Events

NameDescription
ionPickerDidDismissEmitted after the picker has dismissed.
ionPickerDidPresentEmitted after the picker has presented.
ionPickerWillDismissEmitted before the picker has dismissed.
ionPickerWillPresentEmitted before the picker has presented.

ion-picker 内置方法 Methods

dismiss

Description

Dismiss the picker overlay after it has been presented.

Signaturedismiss(data?: any, role?: string | undefined) => Promise<boolean>

getColumn

Description

Get the column that matches the specified name.

SignaturegetColumn(name: string) => Promise<PickerColumn | undefined>

onDidDismiss

Description

Returns a promise that resolves when the picker did dismiss.

SignatureonDidDismiss() => Promise<OverlayEventDetail<any>>

onWillDismiss

Description

Returns a promise that resolves when the picker will dismiss.

SignatureonWillDismiss() => Promise<OverlayEventDetail<any>>

present

Description

Present the picker overlay after it has been created.

Signaturepresent() => Promise<void>

ion-picker 中的 CSS 自定义属性

NameDescription
--backgroundBackground of the picker
--background-rgbBackground of the picker in rgb format
--border-colorBorder color of the picker
--border-radiusBorder radius of the picker
--border-styleBorder style of the picker
--border-widthBorder width of the picker
--heightHeight of the picker
--max-heightMaximum height of the picker
--max-widthMaximum width of the picker
--min-heightMinimum height of the picker
--min-widthMinimum width of the picker
--widthWidth of the picker

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

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

发布评论

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