The command option is not working on TieredMenu

pull/3502/head
mertsincan 2023-01-05 13:12:59 +00:00
parent 2268d6d7d5
commit 77c09018dc
1 changed files with 3 additions and 5 deletions

View File

@ -96,8 +96,8 @@ export default {
getItemKey(processedItem) { getItemKey(processedItem) {
return this.getItemId(processedItem); return this.getItemId(processedItem);
}, },
getItemProp(processedItem, name) { getItemProp(processedItem, name, params) {
return processedItem && processedItem.item ? ObjectUtils.getItemValue(processedItem.item[name]) : undefined; return processedItem && processedItem.item ? ObjectUtils.getItemValue(processedItem.item[name], params) : undefined;
}, },
getItemLabel(processedItem) { getItemLabel(processedItem) {
return this.getItemProp(processedItem, 'label'); return this.getItemProp(processedItem, 'label');
@ -118,9 +118,7 @@ export default {
return ObjectUtils.isNotEmpty(processedItem.items); return ObjectUtils.isNotEmpty(processedItem.items);
}, },
onItemClick(event, processedItem) { onItemClick(event, processedItem) {
const command = this.getItemProp(processedItem, 'command'); this.getItemProp(processedItem, 'command', { originalEvent: event, item: processedItem.item });
command && command({ originalEvent: event, item: processedItem.item });
this.$emit('item-click', { originalEvent: event, processedItem, isFocus: true }); this.$emit('item-click', { originalEvent: event, processedItem, isFocus: true });
}, },
onItemMouseEnter(event, processedItem) { onItemMouseEnter(event, processedItem) {