# v3-directives
**Repository Path**: wqs99/v3-directives
## Basic Information
- **Project Name**: v3-directives
- **Description**: No description available
- **Primary Language**: JavaScript
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 1
- **Forks**: 0
- **Created**: 2022-02-08
- **Last Updated**: 2024-11-08
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# v3-directives vue3自定义指令库
## 使用方法
1. 安装依赖
```
npm install v3-directives --save
```
2. 注册指令
```js
import VueDirectives from "v3-directives";
const app = createApp(App)
app.use(router).mount('#app')
app.use(VueDirectives)
```
基于 vue 的自定义指令集合,包含
- 复制粘贴指令 v-copy
- 图片出错时可使用默认图片 v-RealImg
- 长按指令 v-longpress
- 防抖指令 v-debounce
- 禁止表情及特殊字符 v-emoji
- 限制输入框类型,可传正则 v-input:type
- 图片懒加载 v-LazyLoad
- 权限校验指令 v-premission
- 实现页面水印 v-waterMarker
- 拖拽指令 v-draggable
- 文字超出宽度隐藏 v-ellipsis
- 拖拽指令 v-hide-text
## v-copy
使用:给 Dom 加上 v-copy 及复制的文本即可
```html
```
## v-RealImg
使用:给 Dom 加上 v-RealImg
```html
```
## v-longpress
使用:给 Dom 加上 longpress:[1000] 及回调函数即可,可传时间,单位 ms
```html