'use strict'import Vue from 'vue'import { Prop, Watch } from 'vue-property-decorator'interface ITabs {
name: string
value: string}export default class extends Vue { @Prop({ type: Array, default() { return []
}
}) public tabs!: ITabs[] // TS2416}TS2416: Property 'tabs' in type 'default' is not assignable to thesame property in base type 'object & Record<never,any> & Vue'. Type'ITabs[]' is not assignable totype '{ name: ""; value: ""; }[] |undefined'. Type 'ITabs[]' is not assignable to type '{ name: "";value: ""; }[]'. Type 'ITabs' is not assignable to type '{ name: "";value: ""; }'. Types of property 'name' are incompatible. Type'string' is not assignable to type '""'.
vue-property-decorator @prop 如何定義 Array
江戶川亂折騰
2018-09-02 11:32:58