VUE

typescript

import {
  Component,
  Emit,
  Inject,
  Model,
  Prop,
  Provide,
  Vue,
  Watch
} from 'vue-property-decorator'

const s = Symbol('baz')
@Component
export class MyComponent extends Vue {
  @Emit()
  addToCount(n: number) {
    this.count += n
  }
  @Emit('reset')
  resetCount() {
    this.count = 0
  }
  @Inject() foo: string
  @Inject('bar') bar: string
  @Inject(s) baz: string
  @Model('change') checked: boolean
  @Prop() propA: number
  @Prop({ default: 'default value' })
  propB: string
  @Prop([String, Boolean])
  propC: string | boolean
  @Provide() foo = 'foo'
  @Provide('bar') baz = 'bar'
  @Watch('child')
  onChildChanged(val: string, oldVal: string) {}
  @Watch('person', { immediate: true, deep: true })
  onPersonChanged(val: Person, oldVal: Person) {}
}