Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Component] [table, table-column] 在使用CDN的Element Plus时,表格中的每一列都会独占一行,导致显示效果错乱 #12702

Closed
yu0A opened this issue May 7, 2023 · 5 comments

Comments

@yu0A
Copy link

yu0A commented May 7, 2023

Bug Type: Component

Environment

  • Vue Version: 3.2.47
  • Element Plus Version: 2.3.4
  • Browser / OS: Chrome 113.0.5672.63
  • Build Tool: CDN

Reproduction

Related Component

  • el-table
  • el-table-column

Reproduction Link

Link

Steps to reproduce

直接打开以下html即可复现问题:

What is Expected?

表格中的每行可以显示多个列

What is actually happening?

表格中的每行只能显示一个列

Additional comments

(empty)

@yu0A
Copy link
Author

yu0A commented May 7, 2023

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="title" content="">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <title></title>

    <!-- Import style -->
    <link rel="stylesheet" href="//unpkg.com/element-plus/dist/index.css" />
    <!-- Import Vue 3 -->
    <script src="//unpkg.com/vue@3"></script>
    <!-- Import component library -->
    <script src="//unpkg.com/element-plus"></script>

</head>

<body>
    <div id="app" class="fclass">
        <el-table :data="tableData" :border="true" style="width: 100%">
            <el-table-column prop="date" label="Date" width="180" />
            <el-table-column prop="name" label="Name" width="180" />
            <el-table-column prop="address" label="Address" />
        </el-table>
    </div>
    <script src="" async defer></script>
    <script>
        const { createApp } = Vue

        createApp({
            data() {
                return {
                    message: 'Hello Vue!',
                    User: { date: "Fiat", name: 500, address: "white" },
                    tableRowClassName({ row, rowIndex, }) {
                        if (rowIndex === 1) {
                            return 'warning-row'
                        } else if (rowIndex === 3) {
                            return 'success-row'
                        }
                        return ''
                    },
                    tableData: [
                        {
                            date: '2016-05-03',
                            name: 'Tom',
                            address: 'No. 189, Grove St, Los Angeles',
                        },
                        {
                            date: '2016-05-02',
                            name: 'Tom',
                            address: 'No. 189, Grove St, Los Angeles',
                        },
                        {
                            date: '2016-05-04',
                            name: 'Tom',
                            address: 'No. 189, Grove St, Los Angeles',
                        },
                        {
                            date: '2016-05-01',
                            name: 'Tom',
                            address: 'No. 189, Grove St, Los Angeles',
                        },
                    ]
                }
            }
        }).use(ElementPlus).mount('#app')



    </script>

    <style>
        .el-table .warning-row {
            --el-table-tr-bg-color: var(--el-color-warning-light-9);
        }

        .el-table .success-row {
            --el-table-tr-bg-color: var(--el-color-success-light-9);
        }

        .el-table th.gutter {
            display: table-cell !important;
        }
    </style>
</body>

</html>

@plainheart
Copy link
Member

不要使用自闭标签,参见 FAQ

@yu0A
Copy link
Author

yu0A commented May 7, 2023

不要使用自闭标签,参见 FAQ

改为正常的标签写法之后,表格显示错乱问题得到解决。

@chenxch
Copy link
Member

chenxch commented May 8, 2023

@yu0A Before asking questions, you can search to see if there are already related questions, which can help you solve problems quickly.

@chenxch chenxch closed this as not planned Won't fix, can't repro, duplicate, stale May 8, 2023
@github-actions
Copy link

github-actions bot commented Jun 7, 2023

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

此 issue 已被自动锁定,因为关闭后没有任何近期活动。如果有相关 bug,请重新创建一个新 issue。

@github-actions github-actions bot locked and limited conversation to collaborators Jun 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants