Skip to content

Commit

Permalink
fix(cascader): 修复级联组件无法选中值为 0 的选项 (#2144)
Browse files Browse the repository at this point in the history
修复在级联组件单选状态下,选中项value为0时,label不能正常显示

fix #2143
  • Loading branch information
akinoccc authored Feb 15, 2023
1 parent e32fa46 commit 7069bf2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cascader/core/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function getSingleContent(cascaderContext: CascaderContextType): string {
const {
value, multiple, treeStore, showAllLevels,
} = cascaderContext;
if (multiple || !value) return '';
if (multiple || (typeof value !== 'number' && !value)) return '';

if (Array.isArray(value)) return '';
const node = treeStore && treeStore.getNodes(value as TreeNodeValue | TreeNode);
Expand Down

0 comments on commit 7069bf2

Please sign in to comment.