vue-plugin-helper-decorator
Version:
A bundle of decorator for using vue plugin
63 lines (47 loc) • 1.38 kB
Markdown
# Vue Plugin Helper Decorator
[](https://www.npmjs.com/package/vue-plugin-helper-decorator)
[](https://travis-ci.com/vip30/vue-plugin-helper-decorator)
This library fully depends on [vue-class-component](https://github.com/vuejs/vue-class-component).
## Description
It helps for using vue plugins.
Now support:
* [Vue-socket.io](https://github.com/MetinSeylan/Vue-Socket.io)
* [Vuelidate](https://github.com/monterail/vuelidate)
* [Idle-vue](https://github.com/soixantecircuits/idle-vue)
## License
MIT License
## Install
```bash
npm i -S vue-plugin-helper-decorator
```
## Usage
```typescript
// In component
import { required } from 'vuelidate/lib/validators'
import { SocketIO, Validation, OnIdle, OnActive } from 'vue-plugin-helper-decorator'
export class DummyComponent extends Vue {
public myReconnect() {
console.log('reconnect')
}
public validationObject() {
return {
name: {
required
}
}
}
public whenIdle() {
console,log('Idle now')
}
public whenActive() {
console,log('Active now')
}
}
```