父组件内定义插槽具体内容
<table-data> <!-- 两种方式,下面是简写 <template v-slot:supplierOrderNo="data" >--> <template #supplierOrderNo="data" > {{ data.data}} </template> </table-data>
{ label: "供应商订单号", prop: "supplierOrderNo",type: "slot", slotName: "supplierOrderNo" },
子组件定义插槽位置以及入参
<template v-else-if="item.type && item.type === 'slot'"> <el-table-column :label="item.label" :prop="item.prop" v-bind="item.attr" > <template slot-scope="scope"> <slot :name="item.slotName" :data="scope.row[item.prop]"/> </template> </el-table-column> </template>
标签:传参,supplierOrderNo,插槽,vue2,组件,data From: https://www.cnblogs.com/qq376324789/p/18676414