Skip to content

Commit

Permalink
fix(values-format): 修复defaultLabel无效的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
greper committed Mar 1, 2023
1 parent d81d2b3 commit bb55591
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions packages/fast-crud/src/components/extends/fs-values-format.vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,12 @@ export default {
if (dict) {
options = dict.getNodesFromDataMap(valueArr);
if (props.defaultLabel) {
_.forEach(options, (item) => {
if (item[labelProp] == null) {
item[labelProp] = props.defaultLabel;
}
});
}
//设置默认label
_.forEach(options, (item) => {
if (item[labelProp] == null) {
item[labelProp] = props.defaultLabel || item[valueProp];
}
});
} else {
options = [];
_.forEach(valueArr, (item) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/fast-crud/src/use/use-dict-define.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ class Dict extends UnMergeable {
if (node) {
nodes.push(node);
} else {
nodes.push({ [this.value]: item, [this.label]: item });
nodes.push({ [this.value]: item });
}
});
return nodes;
Expand Down

0 comments on commit bb55591

Please sign in to comment.