需求:点击下拉框,切换组,选中当前项

   <el-dropdown trigger="click" class="child-controllerChild"
                                                             @command="(command) =>handleDispatchTabClickBoxCommand(command)">
                                                    <img class="child-iconAndPhoneImg "
                                                         src="../assets/icons/dispatchAndCall/phoneMoreRow.png"
                                                         alt="">
                                                    <el-dropdown-menu slot="dropdown"
                                                                      class="dispatchContainerDropdownMore">
                                                        <el-dropdown-item v-for="(itemMore,index) in table1PannelMore"
                                                                          :key="index"
                                                                          :command="{commandGroupId:itemMore.id,index:index}">{{itemMore.name}}
                                                        </el-dropdown-item>
                                                    </el-dropdown-menu>
                                                </el-dropdown>

这里绑定对象即可:command="{commandGroupId:itemMore.id,index:index}"

/**
 * 调度table更多切换
 */
handleDispatchTabClickBoxCommand(command) {
  this.dispatchCourentPage = 1;
  this.currentSystemAddressBookItem = command.index;
  //保存当前选中组id,方便分页标识
  this.dispatchMorecommandGroupId = command.commandGroupId;
  this.queryBookmember(command.commandGroupId);
},

效果

在这里插入图片描述

Logo

前往低代码交流专区

更多推荐