<el-table :data="tableData" stripe style="width: 100%">
<el-table-column prop="uid" label="用户ID" />
<el-table-column prop="nickname" label="用户名" />
<el-table-column prop="add_time" label="注册时间" />
<el-table-column fixed="right" label="操作" width="120">
<operations ></operations>
//想要将这个template改成组件,变成上面这张调用形式,请问要如何传递scope的值
<!-- <template #default="scope">
<el-button
type="text"
size="small"
@click.prevent="deleteRow(scope.$index)"
>
删除
</el-button>
</template> -->
</el-table-column>
使用
<template>
将自定义组件包裹即可,将参数作为组件的props