Personally i use mixins alot to share common props between components, for example:
@Component
export default class FlexChildStyle extends Vue {
@LengthProp()
public min?: number | string;
@LengthProp()
public max?: number | string;
@LengthProp()
public basis?: number | string;
@IntegerProp(false, 0)
public grow?: number;
@IntegerProp(false, 0)
public shrink?: number;
public get flexChildStyle() {
return {
flexGrow: this.grow,
flexShrink: this.shrink,
flexBasis: toLength(this.basis),
minWidth: toLength(this.min),
maxWidth: toLength(this.max),
};
}
}
How would this be solved with the function API?