@npm_qy/y-ui
@npm_qy/y-ui
基于 Element Plus 二次封装 + 自研组件的前端组件库(Vue 3)。
- 封装层:对
el-*的二次封装,统一默认值与交互约定(通用弹窗的取消/确定、关闭语义;通用选择弹窗的树/列表面板;文件与头像上传的自绘列表、进度与失败重试),原生 props / slots / 事件继续透传。弹窗内部的面板件(搜索条、行、已选列表)放在组件自己的components/目录,属实现细节,不对外导出 - 自研层:Element Plus 完全没有的能力(复制文本等),数据一律由页面注入,组件内部不发请求
- 主题:内置设计 token,CSS 变量映射到
--el-*,改一处全局换肤
安装
pnpm add @npm_qy/y-ui element-plus
使用
// main.ts
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import YUi from '@npm_qy/y-ui'
import '@npm_qy/y-ui/style.css'
createApp(App).use(ElementPlus).use(YUi).mount('#app')
按需引入:
<script setup>
import { YDialog, YBaseDialog, YUpload, YAvatarUpload, YCopyText } from '@npm_qy/y-ui'
import '@npm_qy/y-ui/style.css'
</script>
主题定制
:root {
--y-color-primary: #7c3aed; /* y-ui 与 element-plus 组件一起变色 */
}
文档:组件 API 与示例见仓库 docs 目录。
License
MIT
Related Packages
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.2.0 | ^3.4.0 | MIT | |
| 0.1.0 | ^3.4.0 | MIT |
Pre-releases (1)
| Version | Released | License |
|---|---|---|
| 0.0.0-stage |