Skip to content

Member functions as default prop values

Latest
Compare
Choose a tag to compare
@itsfrank itsfrank released this 28 Jul 22:32
· 2 commits to master since this release

This update allows you to define default prop values for functions as member functions:

@VueComponent
export class Component extends Vue {
    @Prop functionProp():number{
        console.log('this is the default function);
        return 10;
    }

    @Prop otherFuncProp:(a:string)=>void = function(a) {
        console.log(a + 'this is also in the default function for this prop');
    }
}