@hy-app/ui
v1.0.3
Published
📱一个基于vue3+ts构建的uni-app组件库,拥有八十多个精美组件,适配多端,支持自定义主题
Downloads
1,016
Maintainers
Readme
支持平台
| APP(vue) | H5(网页版) | 微信小程序 | 支付宝小程序 | |----------|---------|-------|--------| | ✔ | ✔ | ✔ | ✔ |
📖 在线文档
📱 移动端预览
安装教程
# 安装组件库(仅支持 Vue 3 + UniApp + TypeScript 项目)
pnpm add @hy-app/ui
# 安装依赖(如果项目中未安装)
pnpm add dayjs
# Node 版本要求 >= 16.14.0🚀 快速上手
1. 全局注册(main.ts)
import { globalRegister } from "@hy-app/ui";
import { createSSRApp } from "vue";
export function createApp() {
const app = createSSRApp(App);
app.use(globalRegister);
return { app };
}2. 使用工具函数
<template>
<!-- 获取 0-10 之间的随机数 -->
<div>{{ $hy.random(1, 10) }}</div>
</template>3. 配置 Volar 类型识别
// tsconfig.json
{
"compilerOptions": {
"types": ["@hy-app/ui/global"]
}
}4. 配置按需引入(page.json)
{
"easycom": {
"custom": {
"^hy-(.*)": "@hy-app/ui/components/hy-$1/hy-$1.vue"
}
}
}5. 全局导入样式(uni.scss)
// uni.scss
@use "@hy-app/ui/index.scss" as *;🤝 贡献指南
欢迎大家参与项目开发!如果你有任何问题或更好的建议,欢迎:
- 提交 Issue:https://github.com/MrGao-hy/hy-design-uni/issues
- 提交 PR:欢迎 Fork 项目并提交合并请求
📄 开源协议
MIT License
