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

Protable使用树状数据时第一列数据不能对齐 #316

Open
ayerswu opened this issue Sep 22, 2023 · 6 comments
Open

Protable使用树状数据时第一列数据不能对齐 #316

ayerswu opened this issue Sep 22, 2023 · 6 comments
Labels
bug Something isn't working style style issue

Comments

@ayerswu
Copy link

ayerswu commented Sep 22, 2023

image

上图是官方给的例子,自己实际测试也是这样,展开图标在最前面,文字是对齐的。

image
上图是protable的样式。展开图标和文字对齐了,导致不协调。

@ayerswu ayerswu changed the title Protable使用数据数据时第一列数据不能对齐 Protable使用树状数据时第一列数据不能对齐 Sep 22, 2023
@HalseySpicy HalseySpicy added the bug Something isn't working label Sep 25, 2023
@tlerbao
Copy link

tlerbao commented Sep 27, 2023

这个是老问题了,陈年旧账

@sunnyguohua
Copy link

想问一下,这个问题解决了吗?

@HalseySpicy HalseySpicy added the style style issue label Oct 26, 2023
@mynetfan
Copy link

缺少了table__placeholder,手动补一下,用插槽或者渲染函数,在实际的内容之前添加

<span class="el-table__placeholder" v-if="!row.children"></span>

@mynetfan
Copy link

缺少了table__placeholder,手动补一下,用插槽或者渲染函数,在实际的内容之前添加

<span class="el-table__placeholder" v-if="!row.children"></span>

这样的话,多级树除了第一级之外的节点又会多了空白占位,还得在/src/styles/element.scss里增加:

.el-table__placeholder + .el-table__placeholder {
    display: none;
}

@ayerswu
Copy link
Author

ayerswu commented Nov 21, 2023

缺少了table__placeholder,手动补一下,用插槽或者渲染函数,在实际的内容之前添加

<span class="el-table__placeholder" v-if="!row.children"></span>

这样的话,多级树除了第一级之外的节点又会多了空白占位,还得在/src/styles/element.scss里增加:

.el-table__placeholder + .el-table__placeholder {
    display: none;
}

上面的方案有个缺陷就是在所有的行都没子节点的情况下,会多一个空格,给人的感觉就是整体缩进了一个空格

@mynetfan
Copy link

mynetfan commented Nov 24, 2023

缺少了table__placeholder,手动补一下,用插槽或者渲染函数,在实际的内容之前添加

<span class="el-table__placeholder" v-if="!row.children"></span>

这样的话,多级树除了第一级之外的节点又会多了空白占位,还得在/src/styles/element.scss里增加:

.el-table__placeholder + .el-table__placeholder {
    display: none;
}

上面的方案有个缺陷就是在所有的行都没子节点的情况下,会多一个空格,给人的感觉就是整体缩进了一个空格

v-if="!row.children" 改成 v-if="!row.children && row.children > 0" 这样就可以了。总之,这个占位节点只在有子节点的时候才显示就达到了目的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working style style issue
Projects
None yet
Development

No branches or pull requests

5 participants