为什么这是错的?帮我。我该怎么办。看起来img
@Prop(Array) menu!: object
created() {
this.$nextTick(() => {
bus.$emit('user', this.menu[0].childs)
})
}
mounted() {
}
如果您已将类型定义为
childs
,则无法访问属性object
。因此,您可以定义特定类型,也可以使用以下内容。
@Prop(Array) menu!: { [index : string] : any}