
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
p-component-lib
Advanced tools
一个基于Vue 3的现代化组件库。
npm install p-component-lib
import { createApp } from 'vue'
import PComponentLib from 'p-component-lib'
import 'p-component-lib/dist/style.css'
const app = createApp(App)
app.use(PComponentLib)
import { Button } from 'p-component-lib'
import 'p-component-lib/dist/style.css'
基础的按钮组件。
<template>
<Button type="primary">Primary Button</Button>
</template>
<script setup>
import { Button } from 'p-component-lib'
</script>
<template>
<Button type="primary">Primary</Button>
<Button type="secondary">Secondary</Button>
<Button type="success">Success</Button>
<Button type="warning">Warning</Button>
<Button type="danger">Danger</Button>
</template>
<template>
<Button size="small">Small</Button>
<Button size="medium">Medium</Button>
<Button size="large">Large</Button>
</template>
<template>
<Button disabled>Disabled</Button>
<Button loading>Loading</Button>
<Button block>Block Button</Button>
</template>
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| type | primary | secondary | success | warning | danger | primary | 按钮类型 |
| size | small | medium | large | medium | 按钮尺寸 |
| disabled | boolean | false | 是否禁用 |
| loading | boolean | false | 是否加载中 |
| block | boolean | false | 是否块级元素 |
| 事件名 | 描述 |
|---|---|
| click | 点击按钮时触发 |
组件库支持自定义主题,可以通过CSS变量来定制颜色、尺寸等。
:root {
--p-primary-color: #409eff;
--p-primary-hover-color: #66b1ff;
--p-font-size-medium: 14px;
/* 更多变量... */
}
# 安装依赖
npm install
# 启动开发服务器
npm run dev
# 构建组件库
npm run build
# 运行测试
npm run test
# 启动文档服务器
npm run dev:docs
# 构建文档
npm run build:docs
本项目遵循标准的 npm 包结构,只有必要的文件会被发布到 npm:
p-component-lib/
├── dist/ # 构建输出目录(发布到npm)
│ ├── p-component-lib.es.js # ES模块格式
│ ├── p-component-lib.umd.js # UMD格式
│ ├── style.css # 样式文件
│ └── types/ # TypeScript声明文件
│ └── index.d.ts
├── package.json # 包配置文件
├── README.md # 项目说明
└── LICENSE # 许可证
源代码、文档、测试和配置文件等不会被包含在发布的包中,以减小包体积。
更新版本号
npm version patch # 补丁版本 x.x.1
npm version minor # 次要版本 x.1.x
npm version major # 主要版本 1.x.x
构建并发布
npm run build
npm publish
欢迎提交 Issue 和 Pull Request!
FAQs
A Vue3 component library with modern design and TypeScript support
We found that p-component-lib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.