ActionSheet 动作面板

从底部弹出的菜单列表,提供多个操作选项

演示

9:41

代码示例

<!-- 操作 -->
  <re-button theme="primary" @click="visible = true">打开动作面板</re-button>

<!-- 事件日志 -->
  <re-action-sheet :key="current" :visible="visible" :title="currentConfig.title" :description="currentConfig.description" :show-cancel="currentConfig.showCancel" :cancel-text="currentConfig.cancelText" :items="currentConfig.items" :close-on-click-overlay="currentConfig.closeOnClickOverlay" @update:visible="onVisibleChange" @selected="onSelect" @cancel="onCancel" @close="onClose" />

引入

推荐使用 easycom 模式,配置后无需手动 import 即可直接使用 <re-action-sheet />。

API

ActionSheet Props

名称类型默认值描述必传
visiblebooleanfalse-N
itemsArray<ActionSheetItem> as Array<ActionSheetItem>-N
titlestring''标题N
descriptionstring''-N
cancelTextstring'取消'-N
showCancelbooleantrue-N
closeOnClickOverlaybooleantrue-N
customStylestring''自定义样式N

ActionSheet Events

名称参数描述
update:visiblevalue: boolean显隐变化时触发
selectedindex: number, item: ActionSheetItem选中时触发
cancel-取消时触发
close-关闭时触发

ActionSheet Slots

名称描述
default默认插槽