# undraw-ui **Repository Path**: undraw/undraw-ui ## Basic Information - **Project Name**: undraw-ui - **Description**: vue评论组件,🔥基于vue3的UI组件,主要功能有评论,聊天,搜索,锚点。你的⭐️Star ,是作者开发的动力! - **Primary Language**: TypeScript - **License**: MIT - **Default Branch**: master - **Homepage**: https://readpage.github.io/undraw-ui/ - **GVP Project**: No ## Statistics - **Stars**: 464 - **Forks**: 59 - **Created**: 2022-04-09 - **Last Updated**: 2025-06-09 ## Categories & Tags **Categories**: vue-extensions **Tags**: Vue, TypeScript ## README
Undraw UI - A Vue.js 3 UI library
暗黑主题

3. 搜索(input关键词动态滚动)

4. 锚点

## 入门
请遵循[https://readpage.github.io/undraw-ui/](https://readpage.github.io/undraw-ui/)上的文档!
## 地址
- [gitee⚡️](https://gitee.com/undraw/undraw-ui)
- [github📌](https://github.com/readpage/undraw-ui)
## 安装
使用`npm`安装
element-plus可以选择需要版本
```sh
npm i element-plus@2.6.0 undraw-ui@1.2.7
```
## 导入
### 按需导入(推荐)
您需要使用额外的插件来导入要使用的组件。
首先你需要安装 unplugin-vue-components 两款插件。
```sh
npm install -D unplugin-vue-components
```
然后修改 vite.config.ts 或 vue.config.js 的配置。
```ts
import Components from 'unplugin-vue-components/vite'
import { UndrawUiResolver } from 'undraw-ui/es/resolvers'
export default {
plugins: [
Components({
resolvers: [UndrawUiResolver]
}),
],
}
```
### 全局注册(不推荐)-选择按需导入忽略
如果你对打包后的文件大小不是很在乎,那么使用完整导入会更方便。
```ts
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import UndrawUi from 'undraw-ui'
import 'undraw-ui/dist/style.css'
const app = createApp(App)
app.use(ElementPlus)
app.use(UndrawUi)
app.mount('#app')
```
## 使用
### fold 折叠组件
```vue
每当白日依山尽,夕阳余辉便透过朵朵云层,像万道金光,如霞光万丈,把天空白云染得红彤彤,把大地山河映得金灿灿,仿佛整个世界在那一瞬间都变得金碧辉煌,热情奔放起来
时间不是某种从我们身上流过的东西,而就是我的生命。弃我而去的不是日历上的一个个日子,而是我生命中的岁月;甚至也不仅仅是我的岁月,而就是我自己。我不但找不回逝去的岁月,而且也找不回从前的我了。