Element: 在 table 中使用 dropdown,如何将当前 row 传予 @command?

Created on 2 Mar 2017  ·  2Comments  ·  Source: ElemeFE/element

<el-table-column
  inline-template
  :context="_self"
  label="操作">
  <template>
    <el-dropdown @command="onOperate">
      <span class="el-dropdown-link">
        操作
      </span>
      <el-dropdown-menu slot="dropdown">
        <el-dropdown-item command="approve">通过</el-dropdown-item>
        <el-dropdown-item command="reject">驳回</el-dropdown-item>
      </el-dropdown-menu>
    </el-dropdown>
  </template>
</el-table-column>

image

这种用法(在表格中以下拉菜单形式呈现按钮组)如果合理的话,理应能将当前 row 传给 @command 事件。但 @command 默认带上 command 字符串,能否也带上 row

Most helpful comment

Never mind. @command is unnecessary. Could totally use @click event, but remember to use .native flag - that would be @click.native on el-dropdown-item.

All 2 comments

Never mind. @command is unnecessary. Could totally use @click event, but remember to use .native flag - that would be @click.native on el-dropdown-item.

大佬,怎么解决的啊?

Was this page helpful?
0 / 5 - 0 ratings