在html中写好对应的名字
<el-col :span="4" :xs="24" style="height:800px;border-right:2px solid #f3f6f8">
<operator-manual-tree-list ref="tree" @node-click="handleNodeClick" :directoryType="queryParams.directoryType"/>
</el-col>
导入文件地址
import OperatorManualTreeList from '@/views/document/OperatorManualTreeList'
在components声明一下
components: {
OperatorManualTreeList,
},
父向子传值
:directoryType="queryParams.directoryType"
子在components下写,与data同级
props:{
directoryType:String
},
传值后可以直接在created里面赋值
created() {
this.queryParams.directoryType = this.directoryType
},