What's the correct way to set the type attribute of the @Prop decorator to Array<string>? Is it even possible?
I'm only able to set it to Array without string like so:
<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator';
@Component
export default class MyComponent extends Vue {
@Prop({ type: Array, default: [] }) private readonly myProperty!: string[];
}
</script>
When I try to change it to Array<string> or even string[] I receive the following error:
Argument of type '{ type: boolean; default: never[]; }' is not assignable
to parameter of type 'PropOptions<any> | Constructor | Constructor[] | undefined'.
Types of property 'type' are incompatible. Type 'boolean' is not assignable to type
'(new (...args: string[]) => Function) | (() => any) | (new (...args: never[]) => any) | Prop<any>[] | undefined'.
This error message confuses me even more: why is the type now recognised as boolean?