<tap-action-sheet>
动作面板组件。从屏幕底部滑出,供用户在多个操作之间进行选择。
Example
Loading...
<tap-action-sheet
.heading=${"选择操作"}
.description=${"请选择您要对该条目执行的操作"}
.groups=${ [ { "actions": [ {"label":"分享至好友"}, {"label":"收藏此内容"}, {"label":"删除","danger":true} ] } ] }
.cancel=${true}></tap-action-sheet>
命令式调用
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 |
