element-UI dropdown 傳多個參數


<el-dropdown class="dropdown_btn" @command="handleCommand">
   <span class="el-dropdown-link">更多</span>
   <el-dropdown-menu slot="dropdown">
      <el-dropdown-item :command="beforeHandleCommand('a',scope.row)">設備訂單</el-dropdown-item>
      <el-dropdown-item :command="beforeHandleCommand('b',scope.row)">設備位置</el-dropdown-item>
      <el-dropdown-item :command="beforeHandleCommand('c',scope.row)">設備轉移</el-dropdown-item>
   </el-dropdown-menu>
</el-dropdown>
handleCommand(command){
   switch (command.command) {
      case "a":
        // 設備訂單
        this.toOrder(command.row.deviceId)
         break;
       case "b":
         // 設備位置
         // this.deleteUser(command.index,command.row);
         break;
       case "c":
         // 設備轉移
         // this.assignRole(command.index,command.row);
          break;
     }
},
beforeHandleCommand(item,row){
  return {
     'command': item,
     'row': row
  }
}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM