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-toolbar

v1.0.2

Published

zx-toolbar 工具栏组件

Downloads

25

Readme

zx-toolbar 工具条

介绍

zx-toolbar 是一个常用于页面顶部或底部的工具操作条组件。通常用于展示标题、取消和确认等操作按钮。

基本用法

基础示例

<template>
  <zx-toolbar 
    title="标题" 
    @cancel="onCancel" 
    @confirm="onConfirm"
  />
</template>

<script setup>
const onCancel = () => {
  console.log('点击取消');
}

const onConfirm = () => {
  console.log('点击确认');
}
</script>

自定义文字和颜色

<template>
  <zx-toolbar 
    title="自定义文字和颜色" 
    cancelText="返回" 
    confirmText="提交" 
    cancelColor="#ff5500" 
    confirmColor="#07c160"
  />
</template>

使用插槽自定义内容

<template>
  <zx-toolbar>
    <template #left>
      <view class="custom-left">
        <zx-icon name="arrow-left" size="20"></zx-icon>
        <text>返回</text>
      </view>
    </template>
    
    <template #center>
      <view class="custom-title">
        <zx-icon name="home" size="18"></zx-icon>
        <text>自定义标题</text>
      </view>
    </template>
    
    <template #right>
      <view class="custom-right">
        <zx-button type="primary" size="mini">提交</zx-button>
      </view>
    </template>
  </zx-toolbar>
</template>

自定义样式

<template>
  <zx-toolbar 
    title="自定义样式" 
    :customStyle="{ 
      backgroundColor: '#f8f8f8', 
      borderBottom: '1px solid #eee' 
    }"
  />
</template>

API

Props

| 参数 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | | show | 是否展示工具条 | Boolean | true | | cancelText | 取消按钮的文字 | String | '取消' | | confirmText | 确认按钮的文字 | String | '确认' | | cancelColor | 取消按钮的颜色 | String | '#2b85e4' | | confirmColor | 确认按钮的颜色 | String | '#2b85e4' | | title | 标题文字 | String | '' | | customStyle | 自定义样式 | Object | {} | | bgColor | 背景颜色 | String | '#ffffff' |

Events

| 事件名 | 说明 | 回调参数 | | --- | --- | --- | | cancel | 点击取消按钮时触发 | - | | confirm | 点击确认按钮时触发 | - |

Slots

| 名称 | 说明 | | --- | --- | | left | 自定义左侧内容 | | center | 自定义中间内容 | | right | 自定义右侧内容 |

常见问题

如何在页面底部固定工具条?

可以通过外层容器定位来实现:

<template>
  <view class="footer-toolbar">
    <zx-toolbar title="底部工具条" />
  </view>
</template>

<style>
.footer-toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  /* 如果有安全区域需求,可以配合 zx-safe-bottom 组件使用 */
}
</style>