element-UI dropdown 传多个参数
<el
-table
-column label
="操作" fixed
="right" width
="180">
<template slot
-scope
="scope">
<el
-dropdown split
-button type
="primary" size
="mini" @click
="optRecord(scope.row)" @command
="handleCommand">
操作记录
<el
-dropdown
-menu slot
="dropdown">
<el
-dropdown
-item
:command
="beforeHandleCommand('a',scope.row.id)">重启
</el
-dropdown
-item
>
<el
-dropdown
-item
:command
="beforeHandleCommand('b',scope.row.id)">删除
</el
-dropdown
-item
>
</el
-dropdown
-menu
>
</el
-dropdown
>
<!-- <el
-button size
="mini" type
="danger" plain @click
="delDialog(scope.row.id)">删除
</el
-button
> -->
</template
>
</el
-table
-column
>
handleCommand(command
){
switch (command
.command
) {
case "a":
this
.reload(command
.id
)
break;
case "b":
this
.delDialog(command
.id
)
break;
}
},
beforeHandleCommand(item
,id
){
return {
'command': item
,
'id': id
}
},
转载请注明原文地址:https://tech.qufami.com/read-8107.html