1.0.13 • Published 7 years ago

vue-class-decorators v1.0.13

Weekly downloads
12
License
MIT
Repository
github
Last release
7 years ago

Vue Class Decorators

This library fully depends on vue-class-component.

License

MIT License

Install

npm i -S vue-class-decorators

Usage

'use strict';
import { Component, prop, watch } from 'vue-class-decorators';

@Component({})
export class Component {
    @prop(Number)
    propA: number;

    @prop({
      type: String,
      default: 'default value'
    })
    propB: string;

    @watch('child')
    onChildChanged(val: string, oldVal: string) {}
}

becomes

'use strict'
export const Component = Vue.extend({
    props: {
        propA: Number,
        propB: {
            type: String,
            required: true,
            default: ''
        }
    },
    methods: {
        onChildChanged(val, oldVal) {}
    },
    watch: {
        'child': 'onChildChanged'
    }
})
1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago