File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 8787
8888 <li v-for =" (tag, index) in searchResults"
8989 :key =" index"
90- v-html =" tag[displayField] || tag[textField] "
90+ v-html =" getDisplayField( tag) "
9191 @mouseover =" searchSelection = index"
9292 @mousedown.prevent =" tagFromSearchOnClick(tag)"
9393 v-bind:class =" {
@@ -864,6 +864,18 @@ export default {
864864 return JSON .stringify (tag);
865865 },
866866
867+ getDisplayField (tag ) {
868+ const hasDisplayField = this .displayField !== undefined
869+ && this .displayField !== null
870+ && tag[this .displayField ] !== undefined
871+ && tag[this .displayField ] !== null
872+ && tag[this .displayField ] !== ' ' ;
873+
874+ return hasDisplayField
875+ ? tag[this .displayField ]
876+ : tag[this .textField ];
877+ },
878+
867879 cloneArray (arr ) {
868880 return arr .map (el => Object .assign ({}, el));
869881 }
You can’t perform that action at this time.
0 commit comments