Skip to content

vc-table里面的EXPAND_COLUMN用indexOf和includes判断导致出问题 #8243

Open
@lllianreg

Description

@lllianreg

- [ ] I have searched the issues of this repository and believe that this is not a duplicate.

Version

undefined

Environment

all env

Reproduction link

http://www.baidu.com

Steps to reproduce

const columns = ref([{title: '序号', dataIndex: 'key', key: 'key', align: 'center'}, {}])

What is expected?

箭头在第二列

What is actually happening?

源码es\vc-table\hooks\useColumns.js
107行 if (!cloneColumns.includes(EXPAND_COLUMN)) {
117行 const expandColumnIndex = cloneColumns.indexOf(EXPAND_COLUMN);
实际上EXPAND_COLUMN指向一个空对象 并不能用includes or indexOf判断 只能使用expandIconColumnIndex 但是这里会导致使用expandIconColumnIndex一直预警

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions