# vue3-slot-event
**Repository Path**: thesadboy/vue3-slot-event
## Basic Information
- **Project Name**: vue3-slot-event
- **Description**: Vue3中给slot添加事件的容器库(代码截取于ElementPlus的only-child)
- **Primary Language**: TypeScript
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2023-03-17
- **Last Updated**: 2024-01-30
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# SlotEvents
> 一个vue3上给slot添加事件的容器组件,代码基于element-plus的only-child
## 安装
```bash
npm install vue3-slot-events
# or
yarn add vue3-slot-events
```
## 引入
```typescript
// 全局引入
import {createApp} from 'vue'
import App from './App.vue'
import SlotEvents from 'vue3-slot-events'
const app = createApp(App)
app.use(SlotEvents)
app.mount('#app')
// 局部引入
import {SlotEvents} from 'vue3-slot-events'
```
## 使用
> SlotTest.vue
```vue