
vue-property-decorator装饰器用法
前言 在Vue中使用typescript,通过使用vue-property-decorator装饰器来简化书写。 装饰器 @Component @Emit @Prop @PropSync @Watch @Inject @Provide @Model @Ref Mixins @Component 声明组件 import { Vue,Component } from 'vue-property-decorator' import {componentA} from '@/components' @Component({ components: {componentA} // 其他组件声明 }) // @Component export default class '组件名' extends Vue { private valueA: string = '我是ValueA' // data里的变量 private valueB: number[] = [1,2,3] private get
•
5 分钟阅读