# @logmei/vue-short-cut

> ## Project setup ``` npm install ```

Latest version **0.1.4** (published 2019-08-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @logmei/vue-short-cut
pnpm add @logmei/vue-short-cut
yarn add @logmei/vue-short-cut
bun add @logmei/vue-short-cut
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2019-08-14 |
| First published | 2019-08-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 248.6 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | logmei |
| Maintainers | logmei |

## Links

- npm: https://www.npmjs.com/package/@logmei/vue-short-cut
- Repository: https://github.com/logmei/vue-short-cut
- Homepage: https://github.com/logmei/vue-short-cut#readme
- Issues: https://github.com/logmei/vue-short-cut/issues
- npm.io page: https://npm.io/package/@logmei/vue-short-cut

## Dependencies (2)

- [vue](https://npm.io/package/vue.md) ^2.6.10
- [core-js](https://npm.io/package/core-js.md) ^2.6.5

## Recent versions

- 0.1.4 (latest) — 2019-08-14
- 0.1.3 — 2019-08-13
- 0.1.2 — 2019-08-13
- 0.1.1 — 2019-08-13

## README

# vue-short-cut

## Project setup
```
npm install
```

### Compiles and hot-reloads for development
```
npm run serve
```

### Compiles and minifies for production
```
npm run build
```

### Run your tests
```
npm run test
```

### Lints and fixes files
```
npm run lint
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

### 使用说明

* 1、引入指令
```
import shortCut from '@/directive/short-cut'
```

* 2、局部注册
```
 directives: {
    shortCut
  }
```
* 3、全局注册
```
 Vue.use(shortCut)
``` 
* 4、指令```v-shortCut```
 > ##### 1.0版本
 > * 指令名：keydown
 > * 修饰符：keyDown（回车和上下左右键）、arrow（上下左右键）、enter（回车键）、self（指定元素）
#### 接收值说明
 >##### 1、self（value接收值为id的值或id的数组）
   >* 字符串：
    ```js
    v-shortCut:keydown.keyDown.self="'aa'"
    ```
   >* 数组：```js
   v-shortCut:keydown.keyDown.self="['aa','bb','cc','dd']"
    ```
>##### 2、其他修饰符
   >* Number类型：值为一行的操作元素个数，用于上下键
   ```js
    v-shortCut:keydown.keyDown="10"
    v-shortCut:keydown.arrow="10"
  ```
   >* 可变值：用于重置光标位置
 ```js
    v-shortCut:keydown.keyDown="s"
    v-shortCut:keydown.arrow="s"
    v-shortCut:keydown.enter="s"
  ```
   >* Object：
   
 ```js
 shortCutObj: {
    rowCount: 11,//值为一行的操作元素个数，用于上下键
    callBack: () => {//获取最后一个元素触发的回调函数
      return this.addRow()
    },
    parenClassName: 'el-table__body-wrapper', //父元素class下的所有操作元素
    ignore:[]//需要忽略的元素  disabled、select、radio、checkbox、date、multi_select (默认忽略：'radio', 'checkbox', 'disabled')
  },
  ```

---
_Source: https://npm.io/package/@logmei/vue-short-cut · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
