<tap-action-sheet>

动作面板组件。从屏幕底部滑出,供用户在多个操作之间进行选择。

Example

命令式调用

import { ActionSheet } from '@mantou/tap-ui/elements/action-sheet';

await ActionSheet.open({
  heading: '分享',
  groups: [
    {
      actions: [
        { label: '复制链接', onClick: () => console.log('copy') },
        { label: '删除', danger: true, onClick: () => console.log('delete') },
      ],
    },
  ],
  cancel: true,
});

API

Shadow DOM; Extends GemElement

Static Methods

Method Type
open <T = unknown>(options: ActionSheetOptions<T>) => DyPromise<ActionSheetAction<T> | undefined, { actionSheet: TapActionSheetElement<T>; sheet: TapSheetElement; }> & ...

Instance Properties

Property(Attribute) Reactive Type
cancelText(cancel-text) Yes string
mode(mode) Yes ActionSheetMode
heading Yes string | TemplateResult
description Yes string | TemplateResult
actions Yes ActionSheetAction<T>[]
groups Yes ActionSheetGroup<T>[]
select Emitter<ActionSheetAction<T>>
cancel Emitter

Other

Type Value
Event select, cancel
Part header, heading, description, group, group-label, action, cancel