vue 插槽上绑定得数据

 <template slot-scope="scope">
        <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
        <el-button type="text" size="small">编辑</el-button>
 </template>

类似于表格数据这种,比如

<slot name="tabel_inner" :data="curTableData">
</slot>

插槽tabel_inner,绑定了一个data数据值为curTableData,

在外面引用

<template #tabel_inner="{data}">
   <right-bar :data="data"/>
</template>

就可以直接在组件right-bar里面使用了

posted @ 2023-11-23 09:02  何歡  阅读(39)  评论(0编辑  收藏  举报