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

jtxxzx-app-components-library

v1.0.2

Published

App 组件库 - 包含 CopyTextBox, TableView, DragonDragButton 等组件

Readme

jtxxzx-app-components-library

基于 Vue 3 + uni-app 的移动端组件库,提供常用组件用于快速开发跨平台应用。

📦 安装

npm install jtxxzx-app-components-library
# 或
yarn add jtxxzx-app-components-library
# 或
pnpm add jtxxzx-app-components-library

⚠️ 重要:需要安装 peerDependencies

组件库依赖以下包,必须在使用者项目中安装

# 安装 uview-plus(必需)
npm install uview-plus@^3.3.6

依赖要求

  • Vue >= 3.5.13
  • uni-app >= 3.0.0
  • uview-plus >= 3.3.6 (必需,组件库使用了 up-tooltip、up-table 等组件)

✨ 特性

  • 🚀 开箱即用 - 提供高质量、易用的基础组件
  • 🎨 uni-app 生态 - 完美支持 uni-app 跨平台框架
  • 📱 多端兼容 - 支持 H5、小程序、App 等多端运行
  • 🔧 按需引入 - 支持 Tree Shaking,按需加载组件
  • 🌐 TypeScript - 完整的 TypeScript 类型定义
  • 🎯 灵活配置 - 提供丰富的 API 和事件回调

📚 组件列表

基础组件

| 组件名 | 说明 | 版本 | | ---------------- | ----------------- | ---- | | CopyTextBox | 可复制文本框组件 | ✅ | | TableView | 表格视图组件 | ✅ | | DragonDragButton | 拖拽按钮组件 | ✅ | | PopupSelect | 弹窗选择器组件 | ✅ | | UaMarkdown | Markdown 渲染组件 | ✅ |

🔨 使用方式

全局注册

⚠️ 重要:必须手动引入样式文件,否则组件样式不会生效!

// main.js
import { createApp } from "vue";
import App from "./App.vue";
import AppComponentsLibrary from "jtxxzx-app-components-library";
// ⚠️ 必须引入样式
import "jtxxzx-app-components-library/dist/style.css";

const app = createApp(App);
app.use(AppComponentsLibrary);
app.mount("#app");

uni-app 项目特别说明

如果你在使用的是 uni-app 项目(HBuilderX 创建),需要在 App.vuemain.js 中引入样式:

方式一:在 App.vue 的 style 标签中引入

<!-- App.vue -->
<template>
    <view>
        <router-view />
    </view>
</template>

<script>
export default {
    onLaunch: function () {
        console.log("App Launch");
    },
};
</script>

<style lang="scss">
/* 引入组件库样式 */
@import "jtxxzx-app-components-library/dist/style.css";
</style>

方式二:在 manifest.json 中配置

{
    "mp-weixin": {
        "styleIsolation": "global"
    }
}

方式三:在 uni.scss 中引入

// uni.scss
@import "jtxxzx-app-components-library/dist/style.css";

按需引入

<template>
    <view>
        <!-- 复制文本框 -->
        <CopyTextBox :text="content" />

        <!-- 表格视图 -->
        <TableView :data="tableData" />

        <!-- 拖拽按钮 -->
        <DragonDragButton @drag="handleDrag" />

        <!-- 弹窗选择器 -->
        <PopupSelect :options="options" @select="handleSelect" />

        <!-- Markdown 渲染 -->
        <UaMarkdown :source="markdownContent" />
    </view>
</template>

<script setup>
import {
  CopyTextBox,
  TableView,
  DragonDragButton,
  PopupSelect,
  UaMarkdown
} from 'jtxxzx-app-components-library'

// ⚠️ 必须引入样式
import 'jtxxzx-app-components-library/dist/style.css'

const content = '这是可复制的文本'
const tableData = [...]
const options = [...]
const markdownContent = '# Hello World'

const handleDrag = (data) => {
  console.log('拖拽数据:', data)
}

const handleSelect = (selected) => {
  console.log('选中项:', selected)
}
</script>

🎨 组件示例

CopyTextBox - 可复制文本框

一键复制文本内容,支持自定义提示。

<template>
    <CopyTextBox text="需要复制的内容" tip-text="复制成功" @copy="handleCopy" />
</template>

TableView - 表格视图

展示表格数据,支持自定义列样式。

<template>
    <TableView :columns="columns" :data="tableData" :row-height="50" />
</template>

DragonDragButton - 拖拽按钮

支持拖拽操作的按钮组件。

<template>
    <DragonDragButton
        :position="buttonPosition"
        @drag="handleDrag"
        @click="handleClick"
    />
</template>

PopupSelect - 弹窗选择器

弹出式选择器,支持单选/多选。

<template>
    <PopupSelect
        v-model="selectedValue"
        :options="options"
        :multiple="false"
        title="请选择"
        @confirm="handleConfirm"
    />
</template>

UaMarkdown - Markdown 渲染

渲染 Markdown 文本,支持代码高亮。

<template>
    <UaMarkdown :source="markdownContent" theme="light" />
</template>

⚙️ API 文档

详细 API 文档请参考:

🎯 兼容性

支持的平台

  • ✅ H5
  • ✅ 微信小程序
  • ✅ 支付宝小程序
  • ✅ 百度小程序
  • ✅ 头条小程序
  • ✅ QQ 小程序
  • ✅ 快手小程序
  • ✅ App(iOS/Android)
  • ✅ HarmonyOS

依赖要求

  • Vue >= 3.5.13
  • uni-app >= 3.0.0

📝 注意事项

1. 必须安装 uview-plus

⚠️ 重要:组件库依赖 uview-plus,必须在使用者项目中安装并配置!

# 安装 uview-plus
npm install uview-plus@^3.3.6

然后在 main.jsmain.ts 中注册 uview-plus:

// main.js
import { createSSRApp } from "vue";
import App from "./App.vue";
// 引入 uview-plus
import uviewPlus from "uview-plus";
// 引入 uview-plus 样式
import "uview-plus/index.scss";

const app = createSSRApp(App);

// 使用 uview-plus
app.use(uviewPlus);

// 使用组件库
import AppComponentsLibrary from "jtxxzx-app-components-library";
import "jtxxzx-app-components-library/dist/style.css";
app.use(AppComponentsLibrary);

app.mount("#app");

uni-app 项目特别配置:

uni.scsspages.json 中配置 easycom 模式,让 uview-plus 组件自动识别:

// pages.json
{
  "easycom": {
    "autoscan": true,
    "custom": {
      "^up-(.*)": "uview-plus/components/u-$1/u-$1.vue"
    }
  }
}

2. 样式必须手动引入

组件库的样式需要手动引入:

// 方式一:在 main.js 中全局引入
import 'jtxxzx-app-components-library/dist/style.css'

// 方式二:在 App.vue 的 style 标签中引入
@import 'jtxxzx-app-components-library/dist/style.css';

// 方式三:在 uni.scss 中引入(推荐 uni-app 项目使用)
@import 'jtxxzx-app-components-library/dist/style.css';

如果忘记引入样式,组件会显示但没有任何样式!

2. uni-app 环境

部分组件依赖 uni API(如 uni.setClipboardDatauni.showToast),请在 uni-app 项目中使用。

3. 版本管理

建议锁定版本号,避免升级导致的不兼容:

{
    "dependencies": {
        "jtxxzx-app-components-library": "1.0.0"
    }
}

4. scoped 样式说明

组件使用 scoped 样式(带 data-v-xxx 属性),这是 uni-app 的标准做法。如果你的项目中样式不生效,请检查:

  • ✅ 是否正确引入了 style.css
  • ✅ 是否有 CSS 冲突或覆盖
  • ✅ 小程序端是否需要配置 styleIsolation: "global"

🐛 问题反馈

如果遇到问题或有建议,欢迎:

  • 提交 Issue
  • 发起 Discussion
  • 联系维护者

📄 License

MIT License


注意:本文档中的预览图片和详细链接待补充,请后续完善以下内容:

  • [ ] 组件预览截图/GIF
  • [ ] 在线演示链接
  • [ ] 完整 API 文档链接
  • [ ] 更新日志链接
  • [ ] 贡献指南链接