Element UI version
2.13.2
OS/Browsers version
windows10/chorme
Vue version
3.0.0-beta.14
Reproduction Link
https://github.com/ElemeFE/element
Steps to reproduce
/src/utils/util.js 文件中 isEmpty 函数校验中当值的类型是number时,如果number值为0?
源码:
if (typeof val === 'number') return !val;
如果val为0,就是一个bug
What is Expected?
if (typeof val === 'number') return !val;
添加判断
What is actually happening?
if (typeof val === 'number') return !val;
添加判断(嗯,应该是bug)
3条答案
按热度按时间yiytaume1#
Translation of this issue:
Element UI version
2.13.2
OS/Browsers version
windows10/chorme
Vue version
3.0.0-beta.14
Reproduction Link
https://github.com/ElemeFE/element
Steps to reproduce
/src/utils/ util.js In the isempty function verification in the file, when the value type is number, if the number value is 0?
Source code:
if (typeof val === 'number') return !val;
If Val is 0, it is a bug
What is Expected?
if (typeof val === 'number') return !val;
Add judgment
What is actually happening?
if (typeof val === 'number') return !val;
Add judgment (well, it should be a bug)
bsxbgnwa2#
0也算是一个空值的
fnx2tebb3#
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.