亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

vue-property-decorator @prop 如何定義 Array

vue-property-decorator @prop 如何定義 Array

江戶川亂折騰 2018-09-02 11:32:58
'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 '""'.
查看完整描述

1 回答

?
嚕嚕噠

TA貢獻1784條經驗 獲得超7個贊

export default class extends Vue {    @Prop({        type: Array,        default() {            return []
        }
    })
    public tabs 
}


查看完整回答
反對 回復 2018-09-02
  • 1 回答
  • 0 關注
  • 4166 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號