<template #default="scope"> <slot :row="scope.row" name="EditColumn"></slot> </template> </el-table-column> </template> 父组件 <template v-slot:EditColumn slot-scope="scope"> <div class="tableAction" @click="data
2)然后在父组件中通过特定的指令slot-scope获取子组件绑定的属性,该指令后面的slotData是允许任意取的名字; 3)接着从slotData中取出子组件插槽绑定的data值:slotData.data。 注意:子组件中绑定属性时,属性名字不能是name这种特殊含义的名词,可以使用data、age、height这些普通含义的名词,因为name具有特殊含义,比如指代...
processIfConditions(element, currentParent) } else if (element.slotScope) { // scoped slot currentParent.plain = false const name = element.slotTarget || '"default"' ;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element } else { // 将元素插入 children 数组中...
<template #default="scope"> <slot :row="scope.row" name="EditColumn"></slot> </template> </el-table-column> </template> 父组件 <template v-slot:EditColumn slot-scope="scope"> 查看 </template> scope row 一直反复报错 拿不到 求教应该如何写 vue2的写法...
<template v-slot:EditColumn slot-scope="scope"> 查看 </template> scope row 一直反复报错 拿不到 求教应该如何写 是不是你这个 slot 对应错了,应该先接收一个默认插槽,默认插槽中在使用具名插槽。
context: Component | void; // rendered in this component's scope functionalContext: Component | void; // only for functional component root nodes key: string | number | void; componentOptions: VNodeComponentOptions | void; componentInstance: Component | void; // component instance ...