vue中使用@click进行传参
在右侧操作栏添加按钮并将该行信息(id)传递到方法中1.template中必须使用slot-scope="scope" 才能在方法handleCount中使用scope.row进行传参</template><template slot="menu" slot-scope="scope"><el-buttontype="text"icon="el-icon-circle
·
在右侧操作栏添加按钮并将该行信息(id)传递到方法中
1.template中必须使用slot-scope="scope" 才能在方法handleCount中使用scope.row进行传参
</template>
<template slot="menu" slot-scope="scope">
<el-button
type="text"
icon="el-icon-circle-plus-outline"
size="small"
@click="handleCount(scope.row)"
>按钮名称
</el-button>
</template>
2.methods
handleCount(row) {
console.log(row.id); //获取该行id
},
更多推荐
已为社区贡献2条内容
所有评论(0)