Skip to content

在table中自定义column模板嵌入Dropdown后,Dropdown的下拉会出现位置不对的情况 #204

@amin168

Description

@amin168

试试下面的demo,columnwidth越大,位置偏离得越厉害,还有handlerItem的点击事情不会触发,不知道是我的用法有问题,还是咋的= =

<template>
    <el-table :data="tableData" style="width: 100%">
        <el-table-column width="250" label="Action" inline-template>
            <el-dropdown text="更多菜单" type="primary" :icon-separate="false">
                <el-dropdown-item @click="handlerItem">选项一</el-dropdown-item>
                <el-dropdown-item>选项二</el-dropdown-item>
                <el-dropdown-item>选项三</el-dropdown-item>
                <el-dropdown-item class="divider">选项四</el-dropdown-item>
            </el-dropdown>
        </el-table-column>

        <el-table-column property="date" label="日期">
        </el-table-column>
        <el-table-column property="name" label="姓名" width="180">
        </el-table-column>
        <el-table-column property="address" label="地址">
        </el-table-column>
    </el-table>
</template>


<script>
    export default {
      data() {
        return {
          tableData: [{
            date: '2016-05-02',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1518 弄'
          }, {
            date: '2016-05-04',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1517 弄'
          }, {
            date: '2016-05-01',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1519 弄'
          }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1516 弄'
          }]
        }
      },
     methods: {
            handlerItem() {
                console.log("impersonate");
            }
        }
    }
</script>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions