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

vite-plugin-tx-ui

v1.1.3

Published

Vite plugin for tx-ui component library - UniApp X + Vue3 + UTS

Readme

vite-plugin-tx-ui

tx-ui 组件库的 Vite 插件,提供组件自动导入和类型声明生成功能。

安装

npm install vite-plugin-tx-ui -D
# 或
pnpm add vite-plugin-tx-ui -D
# 或
yarn add vite-plugin-tx-ui -D

使用

方式一:HBuilderX 项目(推荐)

对于使用 HBuilderX 构建的 UniApp X 项目,只需将 tx-ui 放入 uni_modules 目录即可,无需额外配置。

组件会通过 uni_modules/tx-ui/package.json 中的 easycom 配置自动注册。

方式二:Vite 项目

// vite.config.ts
import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import { txui } from 'vite-plugin-tx-ui'

export default defineConfig({
  plugins: [
    uni(),
    txui()
  ]
})

配置选项

txui({
  // 组件前缀,默认 'tx'
  prefix: 'tx',
  
  // 是否自动导入组件,默认 true
  autoImport: true,
  
  // 组件库路径,默认 'uni_modules/tx-ui'
  componentsDir: 'uni_modules/tx-ui',
  
  // 是否生成类型声明,默认 true
  dts: true,
  
  // 类型声明文件输出路径,默认 'tx-ui.d.ts'
  dtsOutput: 'tx-ui.d.ts'
})

功能

1. 自动导入组件

插件会自动更新 pages.json 中的 easycom 配置,实现组件的自动导入。

<template>
  <!-- 无需手动导入,直接使用 -->
  <tx-button type="primary">按钮</tx-button>
  <tx-icon name="home" />
</template>

2. 类型声明生成

插件会自动生成 tx-ui.d.ts 文件,提供完整的组件类型支持。

// 自动生成的类型声明
declare module "vue" {
  export interface GlobalComponents {
    "tx-button": typeof import('./uni_modules/tx-ui/components/basic/tx-button/tx-button.uvue')['default']
    "tx-icon": typeof import('./uni_modules/tx-ui/components/basic/tx-icon/tx-icon.uvue')['default']
    // ... 更多组件
  }
}

组件列表

tx-ui 包含 77+ 个精心设计的组件:

  • 基础组件: tx-icon, tx-button, tx-text, tx-image, tx-badge, tx-tag, tx-divider, tx-link, tx-space, tx-transition
  • 布局组件: tx-row, tx-col, tx-grid, tx-grid-item, tx-layout, tx-sticky, tx-safe-area, tx-scroll-view
  • 表单组件: tx-input, tx-textarea, tx-checkbox, tx-radio, tx-switch, tx-picker, tx-date-picker, tx-time-picker, tx-slider, tx-rate, tx-stepper, tx-form, tx-form-item 等
  • 反馈组件: tx-toast, tx-loading, tx-modal, tx-dialog, tx-action-sheet, tx-notify, tx-overlay, tx-progress, tx-circle, tx-skeleton 等
  • 导航组件: tx-navbar, tx-tabbar, tx-tabs, tx-sidebar, tx-steps, tx-breadcrumb, tx-back-top 等
  • 展示组件: tx-cell, tx-card, tx-collapse, tx-swiper, tx-list, tx-avatar, tx-empty, tx-table, tx-tree 等
  • 业务组件: tx-search, tx-pull-refresh, tx-load-more, tx-calendar, tx-countdown, tx-qrcode, tx-waterfall 等

License

MIT