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

[Bug Report] Conditional Judgment Inadequate #17256

Closed
agamem opened this issue Aug 31, 2019 · 5 comments
Closed

[Bug Report] Conditional Judgment Inadequate #17256

agamem opened this issue Aug 31, 2019 · 5 comments

Comments

@agamem
Copy link

agamem commented Aug 31, 2019

Element UI version

2.12.0

OS/Browsers version

win10

Vue version

2.6.10

Reproduction Link

https://jsfiddle.net/null

Steps to reproduce

null

What is Expected?

null

What is actually happening?

element/packages/table/src/table-layout.js

Line 100 in 45cb58a

const headerTrElm = headerWrapper.querySelector('.el-table__header tr');

当this.showHeader = false, headerWrapper = undefined 时,100行报错
97 if (this.showHeader && !headerWrapper) return;
98
99 // fix issue (#16956)
100 const headerTrElm = headerWrapper.querySelector('.el-table__header tr');
101 const noneHeader = this.headerDisplayNone(headerTrElm);

@element-bot element-bot changed the title [Bug Report] 条件判断不充分 [Bug Report] Conditional Judgment Inadequate Aug 31, 2019
@element-bot
Copy link
Member

Translation of this issue:

Element UI version

2.12.0

OS/Browsers version

Win10

Vue version

2.6.10

Reproduction Link

Https://jsfiddle.net/null

Steps to reproduce

Null

What is Expected?

Null

What is actually happening?

Element/packages/table/src/table-layout.js

Line 100 in 45cb58a
Const headerTrElm = headerWrapper. querySelector ('.el-table__header tr');

When this. showHeader = false, header Wrapper = undefined, 100 lines report errors
97 if (this. show header & & & header Wrapper) return;

Ninety-eight
99// fix issue ()

100 const headerTrElm = headerWrapper. querySelector ('.el-table__header tr');
101 const noneHeader = this. headerDisplayNone (headerTrElm);

@ziyoung
Copy link
Contributor

ziyoung commented Sep 2, 2019

Issues without a valid reproduction link will be closed directly.

@ziyoung ziyoung closed this as completed Sep 2, 2019
@NavOrange
Copy link

NavOrange commented Sep 2, 2019

<el-table :data="tableData" style="width: 100%" :show-header="false"> <el-table-column fixed prop="date" label="日期" width="180">
https://codepen.io/shuhua95/pen/QWLqwXv

@agamem
Copy link
Author

agamem commented Sep 7, 2019

这个issue跟有没有样例有什么关系?
第97行的条件判断,无法保证第100行的headerWrapper是已经被初始化过的。
很明显的逻辑判断不充分啊!

@ziyoung
Copy link
Contributor

ziyoung commented Sep 9, 2019

这个issue跟有没有样例有什么关系?
第97行的条件判断,无法保证第100行的headerWrapper是已经被初始化过的。
很明显的逻辑判断不充分啊!

@agamem#17341 已经修复了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants