Skip to content

Commit 9b3d51d

Browse files
author
Lionel Bijaoui
committed
fix: customLabel return a basic function when undefined instead of null
1 parent 51abcca commit 9b3d51d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/fields/fieldVueMultiSelect.vue

+8
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
:allow-empty="selectOptions.allowEmpty",
1616
:reset-after="selectOptions.resetAfter",
1717
:close-on-select="selectOptions.closeOnSelect",
18+
:custom-label="customLabel",
1819
:taggable="selectOptions.taggable",
1920
:tag-placeholder="selectOptions.tagPlaceholder",
2021
:max="schema.max || null",
@@ -56,6 +57,13 @@
5657
} else {
5758
return values;
5859
}
60+
},
61+
customLabel(){
62+
if (typeof this.schema.selectOptions !== "undefined" && typeof this.schema.selectOptions.customLabel !== "undefined" && this.schema.selectOptions.customLabel === "function") {
63+
return this.schema.selectOptions.customLabel;
64+
} else {
65+
return function(currentLabel){return currentLabel;};
66+
}
5967
}
6068
},
6169
methods: {

0 commit comments

Comments
 (0)