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

@tanzhenxing/zx-dropdown-menu

v1.0.4

Published

zx-dropdown-menu

Downloads

8

Readme

zx-dropdown-menu 下拉菜单容器组件

下拉菜单的容器组件,用于包裹下拉菜单项。

使用方式

通常作为 zx-dropdown 组件的下拉内容使用:

<zx-dropdown>
  <view class="dropdown-link">
    下拉菜单
    <text class="uni-icons" style="margin-left: 5px;">&#xe6e1;</text>
  </view>
  <template #dropdown>
    <zx-dropdown-menu>
      <zx-dropdown-item command="a">选项1</zx-dropdown-item>
      <zx-dropdown-item command="b">选项2</zx-dropdown-item>
      <zx-dropdown-item command="c">选项3</zx-dropdown-item>
    </zx-dropdown-menu>
  </template>
</zx-dropdown>

组件说明

插槽

| 插槽名 | 说明 | | --- | --- | | default | 下拉菜单的内容,通常放置 zx-dropdown-item 组件 |

注意事项

  • zx-dropdown-menu 组件必须作为 zx-dropdown 组件的 dropdown 插槽内容使用
  • 组件内部应包含一个或多个 zx-dropdown-item 组件
  • 组件样式已经设置为 scoped,不会影响外部样式

完整示例

<template>
  <view>
    <zx-dropdown trigger="click">
      <view class="dropdown-link">
        点击触发
        <text class="uni-icons" style="margin-left: 5px;">&#xe6e1;</text>
      </view>
      <template #dropdown>
        <zx-dropdown-menu>
          <zx-dropdown-item command="view">查看</zx-dropdown-item>
          <zx-dropdown-item command="edit">编辑</zx-dropdown-item>
          <zx-dropdown-item command="delete" divided>删除</zx-dropdown-item>
        </zx-dropdown-menu>
      </template>
    </zx-dropdown>
  </view>
</template>

<script setup>
// 处理命令事件
const handleCommand = (command) => {
  uni.showToast({
    title: `点击了: ${command}`,
    icon: 'none'
  })
}
</script>

<style>
.dropdown-link {
  display: flex;
  align-items: center;
  color: #409eff;
  cursor: pointer;
}
</style>