element icon indicating copy to clipboard operation
element copied to clipboard

[Feature Request] The table expand is unmodifiable

Open leaper1 opened this issue 9 years ago • 7 comments

Existing Component

是

Component Name

el-table

Description

I want expand the row,bug It provides only one style. I want form head tags to explain it, and custom styles. For example, put a button on it that says' click to view details.

leaper1 avatar Oct 27 '17 07:10 leaper1

Translation of this issue:

Existing Component

yes

Component Name

El-table

Description

I want expand the row, bug It provides only one style. I want form head tags to explain it, and custom styles. For example, put a button on it that says'click details. to view

element-bot avatar Oct 27 '17 07:10 element-bot

没有太理解你的意思,请用中文描述一下。

Leopoldthecoder avatar Oct 28 '17 08:10 Leopoldthecoder

我想我也遇到了同样的问题:

    <el-table-column
        prop="intentionNum"
        label="意向数量"
    >
    </el-table-column>
        <el-table-column type="expand">
            <template scope="scope">
                <intention
                    :rec="scope.row.rec"
                    :data="scope.row.intentionList"
                    @lookMobile="lookMobile"
                    @del="handleDel"
                 >
                 </intention>
            </template>
     </el-table-column>

这样使用type="expand“,会在意向数量这一列后面加上expand一列

我尝试去设置width,和设置icon的负margin,但是效果不尽人意

let colgroup = this.$refs.viewListTable.$el.querySelector('.el-table__body-wrapper colgroup')
colgroup.getElementsByTagName('col')[5].width = 12

这里的('col')[5]就是expand这一列。

期望的效果: 把expand方法直接作用在意向数量,而不去多添加一列。而且可以去自定义icon? 谢谢。

nszbf avatar Oct 29 '17 09:10 nszbf

@nszbf 目前不支持这种用法。不过你的需求可以完成:https://jsfiddle.net/6asoxb1o/

Leopoldthecoder avatar Oct 30 '17 09:10 Leopoldthecoder

哦 厉害了,新方法666

nszbf avatar Oct 30 '17 10:10 nszbf

@Leopoldthecoder 在1.4.8中该怎么去做?

nszbf avatar Nov 01 '17 03:11 nszbf

1.x 里做不了

Leopoldthecoder avatar Nov 01 '17 03:11 Leopoldthecoder