Fixed #5038 - v2 Menu | disabled property as a function is not working with command prop (#5039)

2.x
Felix Bernhard 2024-01-16 12:20:44 +01:00 committed by GitHub
parent 1a22f01600
commit c0f99345a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -75,7 +75,7 @@ export default {
methods: { methods: {
itemClick(event) { itemClick(event) {
const item = event.item; const item = event.item;
if (item.disabled) { if (this.disabled(item)) {
return; return;
} }
@ -200,6 +200,9 @@ export default {
visible(item) { visible(item) {
return (typeof item.visible === 'function' ? item.visible() : item.visible !== false); return (typeof item.visible === 'function' ? item.visible() : item.visible !== false);
}, },
disabled(item) {
return (typeof item.disabled === 'function' ? item.disabled() : item.disabled);
},
label(item) { label(item) {
return (typeof item.label === 'function' ? item.label() : item.label); return (typeof item.label === 'function' ? item.label() : item.label);
}, },