Skip to content

Commit

Permalink
fix: 选择器选项文案展示
Browse files Browse the repository at this point in the history
  • Loading branch information
YufJi committed Mar 25, 2024
1 parent 1bb7e1a commit fbc2ad9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/pickerson/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default createComponent({
{this.multiple && (
<div class="icon">
<Checkbox value={checked} shape="square">
{this.slots('option', item) ||
{this.slots('option', {...item, item}) ||
(isInDesigner ? (
<EmptyCol></EmptyCol>
) : (
Expand All @@ -130,7 +130,7 @@ export default createComponent({
)}

{!this.multiple &&
(this.slots('option', item) ||
(this.slots('option', {...item, item}) ||
(isInDesigner ? (
<EmptyCol></EmptyCol>
) : (
Expand Down
6 changes: 3 additions & 3 deletions src/pickerson/PickerColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ export default createComponent({
},

getOptionText(option) {
if (isObject(option) && isDef(_get(option, this.textField))) {
return _get(option, this.textField);
if (isObject(option)) {
return _get(option, this.textField) || '';
}

return option;
Expand Down Expand Up @@ -309,7 +309,7 @@ export default createComponent({

return (
<li {...data} vusion-slot-name="option">
{this.slots('option', option) ||
{this.slots('option', {...option, item: option}) ||
(isInDesigner ? <EmptyCol></EmptyCol> : <div {...childData} />)}
</li>
);
Expand Down

0 comments on commit fbc2ad9

Please sign in to comment.