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

va-admin-tabs

v0.0.3

Published

a tab component of admin template, support vue2 and vue3

Downloads

0

Readme

简介

va-admin-tabs 是一个由 Vue3 + TypeScript + Vite 集成的后台 tab 组件

使用教程

npm install -S va-admin-tabs

or

yarn add va-admin-tabs

快速上手

在 main.ts 中写入以下内容:

// main.ts
import { createApp } from "vue";
import { ButtonTab, ChromeTab } from "va-admin-tabs";
import App from "./App.vue";

const app = createApp(App);

app.component("ButtonTab", ButtonTab);
app.component("ChromeTab", ChromeTab);

app.mount("#app");

在 App.vue 中写入内容

<template>
  <div
    class="h-full p-24px text-14px bg-#f6f9f8"
    :class="{ '!bg-#101014 text-light': darkMode }"
  >
    <div>
      <span class="pr-24px text-24px font-bold">暗黑模式</span>
      <input type="checkbox" :checked="darkMode" @change="handleDarkMode" />
    </div>
    <h3 class="pb-24px text-24px font-bold">ButtonTab</h3>
    <div
      class="tab-shadow pl-16px py-8px bg-white"
      :class="{ '!bg-dark text-white': darkMode }"
    >
      <button-tab :dark-mode="darkMode">default</button-tab>
      <button-tab :dark-mode="darkMode" :is-active="true" class="ml-12px"
        >active</button-tab
      >
      <button-tab :dark-mode="darkMode" :closable="false" class="ml-12px"
        >no-close</button-tab
      >
    </div>
    <div
      class="tab-shadow px-16px py-8px mt-12px bg-white"
      :class="{ '!bg-dark text-white': darkMode }"
    >
      <button-tab :dark-mode="darkMode" primary-color="#5856D6"
        >default</button-tab
      >
      <button-tab
        :dark-mode="darkMode"
        primary-color="#5856D6"
        :is-active="true"
        class="ml-12px"
        >active</button-tab
      >
      <button-tab
        :dark-mode="darkMode"
        primary-color="#5856D6"
        :closable="false"
        class="ml-12px"
        >no-close</button-tab
      >
    </div>
    <h3 class="py-24px text-24px font-bold">ChromeTab</h3>
    <div
      class="tab-shadow pl-16px py-8px bg-white"
      :class="{ '!bg-dark text-white': darkMode }"
    >
      <chrome-tab :dark-mode="darkMode">default</chrome-tab>
      <chrome-tab :dark-mode="darkMode" :is-active="true">active</chrome-tab>
      <chrome-tab :dark-mode="darkMode" :closable="false">no-close</chrome-tab>
    </div>
    <div
      class="tab-shadow px-16px py-8px mt-12px bg-white"
      :class="{ '!bg-dark text-white': darkMode }"
    >
      <chrome-tab :dark-mode="darkMode" primary-color="#5856D6"
        >default</chrome-tab
      >
      <chrome-tab
        :dark-mode="darkMode"
        primary-color="#5856D6"
        :is-active="true"
        >active</chrome-tab
      >
      <chrome-tab
        :dark-mode="darkMode"
        primary-color="#5856D6"
        :closable="false"
        >no-close</chrome-tab
      >
    </div>
  </div>
</template>

<script setup lang="ts">
  import { useBoolean } from "./hooks";

  const { bool: darkMode, toggle } = useBoolean();

  function handleDarkMode() {
    toggle();
  }
</script>

<style>
  html,
  body,
  #app {
    height: 100%;
  }

  .tab-shadow {
    box-shadow: 0 1px 2px rgb(0 21 41 / 8%);
  }
</style>

ButtonTab 属性

| 属性名 | 说明 | 类型 | 默认值 | | :--------------- | :--------------- | :--------------- | :--------------- | | darkMode| 暗黑模式 | boolean | false | | isActive| 激活状态 | boolean | false | | primaryColor| 主题颜色 | string | '#1890ff' | | borderColor| 边框颜色 | string | '#e5e7eb' | | darkBorderColor| 暗黑模式的边框颜色 | string | '#ffffff3d' | | closable| 是否显示关闭图标 | boolean | true |

ButtonTab 事件

| 属性名 | 说明 | 回调参数 | | :--------------- | :--------------- | :--------------- | | close | 关闭tab时触发 | - |

ChromeTab 属性

| 属性名 | 说明 | 类型 | 默认值 | | :--------------- | :--------------- | :--------------- | :--------------- | | darkMode | 暗黑模式 | boolean | false | | isActive | 激活状态 | boolean | false | | primaryColor | 主题颜色 | string | '#1890ff' | | closable | 是否显示关闭图标 | boolean | true | | bgColor | 背景颜色 | [string, string] | () => ['#ffffff', '#18181c'] | | hoverBgColor | 悬浮时的背景颜色 | [string, string] | () => ['#dee1e6', '#3f3c37'] | | mixColor | 激活状态时的混合颜色 | [string, string] | () => ['#ffffff', '#000'] | | mixRatio | 混合比例(主题颜色的占比) | [number, number] | () => [0.13, 0.35] |

ChromeTab 事件

| 属性名 | 说明 | 回调参数 | | :--------------- | :--------------- | :--------------- | | close | 关闭tab时触发 | - |