html源码:
<template>
//:is里面装的是组件名称 :child="child"是指子组件需要的数据
<component :is="isComponent" :child="childValue"></component>
</template>
js源码:
data () {
return {
childValue: {data: [],},
isComponent:"",
}
},
created(){
this.childValue.data=[1,2,3,4,5]
this.isComponent = "你所引入的组件名称";
},