1. 调用
import info from './priceDetail.vue'
components: {Treeselect, info},
<info></info>
2. 父组件向子组件传值
v-bind:name=””
eg:
父:
<info v-bind:type="type" v-bind:row="row"></info>
handleClick(row) {console.log(row)
this.dialogTableVisible = true
this.row=row// 传递的 row
},
子:
props: {
type: {
type: String,
required: true,
},
row:{
type:Object,
required:true
}
},
<el-descriptions title="详细信息" v-if="type =='bw'">
created() {console.log(this.type)
console.log('row',this.row)
},
3.note:
子组件承受的父组件的值分为——援用类型和一般类型两种,
一般类型:字符串(String)、数字(Number)、布尔值(Boolean)、空(Null)
援用类型:数组(Array)、对象(Object)