npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@doraemon-ui/miniprogram.actionsheet

v0.0.1-alpha.1

Published

miniprogram actionsheet component for doraemon-ui

Readme

ActionSheet 动作面板

从底部弹出的操作菜单面板,提供两种主题风格(iOS / WeChat)。

安装

我们推荐使用 npmyarn 的方式进行开发,不仅可在开发环境轻松调试,也可放心地在生产环境打包部署使用,享受整个生态圈和工具链带来的诸多好处。

npm install --save @doraemon-ui/miniprogram.actionsheet
# or
yarn add @doraemon-ui/miniprogram.actionsheet

如果你的网络环境不佳,推荐使用 cnpm

使用指南

在 page.json 中引入组件

json

示例代码

在开发者工具中预览效果

WXML

wxml

JAVASCRIPT

js

API

ActionSheet props

export type ActionSheetButton = {
  /** 按钮文本 */
  text?: string
  /** 按钮图标 */
  icon?: string
  /** 类名 */
  className?: string
  /** 是否禁用 */
  disabled?: boolean
  /** 微信开放能力 */
  openType?: string
  /** 按下时自定义样式类 */
  hoverClass?: string
}

| 参数 | 类型 | 描述 | 默认值 | | ---------------- | ------------------------------ | ----------------------------------------------------- | ---------------- | | prefixCls | string | 自定义类名前缀 | dora-actionsheet | | theme | 'ios' \| 'wx' | 主题风格 | ios | | titleText | string | 标题文本 | - | | buttons | ActionSheetButton[] | 操作按钮列表 | [] | | cancelText | string | 取消按钮文本 | 取消 | | destructiveText | string | 删除按钮文本 | - | | visible | boolean | 是否可见 | false | | bind:action | (event: CustomEvent) => void | 按钮点击事件,detail 包含 { method, button, index } | - | | bind:cancel | () => void | 取消按钮点击事件 | - | | bind:destructive | () => void | 删除按钮点击事件 | - | | bind:close | () => void | 关闭事件 | - | | bind:closed | () => void | 关闭动画完成后的事件 | - |

ActionSheet slot

| 名称 | 描述 | | ---- | ---------- | | - | 自定义内容 |

ActionSheet externalClasses

| 名称 | 描述 | | ---------- | ------------ | | dora-class | 根节点样式类 |

命令式调用

import { actionsheet } from '@doraemon-ui/miniprogram.actionsheet'

// 显示动作面板
const close = actionsheet.show({
  theme: 'ios',
  titleText: '请选择操作',
  buttons: [{ text: '选项一' }, { text: '选项二' }],
  cancelText: '取消',
  onCancel: () => {},
  onClose: () => {},
})

// 手动关闭
close()

// 关闭所有
actionsheet.clear()

CSS Variables

| 属性 | 描述 | 默认值 | 全局变量 | | ------------------------ | ------------------------ | -------------------------- | ------------------------------------------- | | --options-bg | 选项组背景色(iOS 主题) | rgba(255, 255, 255, .65) | --dora-actionsheet-options-bg | | --options-normal-bg | 普通选项组背景色 | @component-background | --dora-actionsheet-options-normal-bg | | --options-cancel-bg | 微信主题取消区域背景色 | @component-background | --dora-actionsheet-options-cancel-bg | | --options-active-bg | 按钮按下时背景色 | @active-state-bg | --dora-actionsheet-options-active-bg | | --text-color | 按钮文字颜色 | #007aff | --dora-actionsheet-text-color | | --border-color | 按钮之间的分隔线颜色 | @border-color-split | --dora-actionsheet-border-color | | --destructive-text-color | 删除按钮文字颜色 | #ff3b30 | --dora-actionsheet-destructive-text-color | | --icon-size | 按钮图标大小 | 20px | - | | --border-radius | 选项组圆角 | 12px | - | | --margin | 内容区域水平边距 | 10px | - |