Fixed #173, Fixed #168, Fixed #169,

pull/193/head
cagataycivici 2020-02-07 09:53:07 +03:00
parent fb962d7937
commit 0007663991
6 changed files with 21 additions and 10 deletions

View File

@ -242,6 +242,7 @@ export default {
padding: .25em;
display: block;
position: relative;
cursor: pointer;
}
.p-contextmenu .p-menuitem-icon {

View File

@ -4,13 +4,12 @@
<template v-for="(item, i) of model">
<li role="none" :class="getItemClass(item)" :style="item.style" v-if="item.visible !== false && !item.separator" :key="item.label + i"
@mouseenter="onItemMouseEnter($event, item)">
<router-link v-if="item.to" :to="item.to" class="p-menuitem-link"
@click.native="onItemClick($event, item)" role="menuitem">
<router-link v-if="item.to" :to="item.to" :class="getLinkClass(item)" @click.native="onItemClick($event, item)" role="menuitem">
<span :class="['p-menuitem-icon', item.icon]"></span>
<span class="p-menuitem-text">{{item.label}}</span>
</router-link>
<a v-else :href="item.url||'#'" class="p-menuitem-link" :target="item.target"
@click="onItemClick($event, item)" :aria-haspopup="item.items != null" :aria-expanded="item === activeItem" role="menuitem">
<a v-else :href="item.url" :class="getLinkClass(item)" :target="item.target" @click="onItemClick($event, item)"
:aria-haspopup="item.items != null" :aria-expanded="item === activeItem" role="menuitem" :tabindex="item.disabled ? null : '0'">
<span :class="['p-menuitem-icon', item.icon]"></span>
<span class="p-menuitem-text">{{item.label}}</span>
<span class="p-submenu-icon pi pi-fw pi-caret-right" v-if="item.items"></span>
@ -115,6 +114,9 @@ export default {
'p-disabled': item.disabled,
}
]
},
getLinkClass(item) {
return ['p-menuitem-link', {'p-disabled': item.disabled}];
}
},
computed: {

View File

@ -49,6 +49,7 @@ export default {
padding: .25em;
position: relative;
text-decoration: none;
cursor: pointer;
}
.p-menubar .p-menuitem-icon {

View File

@ -3,13 +3,13 @@
<template v-for="(item, i) of model">
<li role="none" :class="getItemClass(item)" :style="item.style" v-if="item.visible !== false && !item.separator" :key="item.label + i"
@mouseenter="onItemMouseEnter($event, item)">
<router-link v-if="item.to" :to="item.to" class="p-menuitem-link"
<router-link v-if="item.to" :to="item.to" :class="getLinkClass(item)"
@click.native="onItemClick($event, item)" @keydown.native="onItemKeyDown($event, item)" role="menuitem">
<span :class="['p-menuitem-icon', item.icon]"></span>
<span class="p-menuitem-text">{{item.label}}</span>
</router-link>
<a v-else :href="item.url||'#'" class="p-menuitem-link" :target="item.target" :aria-haspopup="item.items != null" :aria-expanded="item === activeItem"
@click="onItemClick($event, item)" @keydown="onItemKeyDown($event, item)" role="menuitem">
<a v-else :href="item.url" :class="getLinkClass(item)" :target="item.target" :aria-haspopup="item.items != null" :aria-expanded="item === activeItem"
@click="onItemClick($event, item)" @keydown="onItemKeyDown($event, item)" role="menuitem" :tabindex="item.disabled ? null : '0'">
<span :class="['p-menuitem-icon', item.icon]"></span>
<span class="p-menuitem-text">{{item.label}}</span>
<span :class="getSubmenuIcon()" v-if="item.items"></span>
@ -240,6 +240,9 @@ export default {
}
]
},
getLinkClass(item) {
return ['p-menuitem-link', {'p-disabled': item.disabled}];
},
bindDocumentClickListener() {
if (!this.documentClickListener) {
this.documentClickListener = (event) => {

View File

@ -189,6 +189,7 @@ export default {
display: block;
position: relative;
text-decoration: none;
cursor: pointer;
}
.p-tieredmenu .p-menuitem-icon {

View File

@ -3,13 +3,13 @@
<template v-for="(item, i) of model">
<li :class="getItemClass(item)" :style="item.style" v-if="item.visible !== false && !item.separator" :key="item.label + i"
@mouseenter="onItemMouseEnter($event, item)" role="none">
<router-link v-if="item.to" :to="item.to" class="p-menuitem-link"
<router-link v-if="item.to" :to="item.to" :class="getLinkClass(item)"
@click.native="onItemClick($event, item)" @keydown.native="onItemKeyDown($event, item)" role="menuitem">
<span :class="['p-menuitem-icon', item.icon]"></span>
<span class="p-menuitem-text">{{item.label}}</span>
</router-link>
<a v-else :href="item.url||'#'" class="p-menuitem-link" :target="item.target" :aria-haspopup="item.items != null" :aria-expanded="item === activeItem"
@click="onItemClick($event, item)" @keydown="onItemKeyDown($event, item)" role="menuitem">
<a v-else :href="item.url" :class="getLinkClass(item)" :target="item.target" :aria-haspopup="item.items != null" :aria-expanded="item === activeItem"
@click="onItemClick($event, item)" @keydown="onItemKeyDown($event, item)" role="menuitem" :tabindex="item.disabled ? null : '0'">
<span :class="['p-menuitem-icon', item.icon]"></span>
<span class="p-menuitem-text">{{item.label}}</span>
<span class="p-submenu-icon pi pi-fw pi-caret-right" v-if="item.items"></span>
@ -191,6 +191,9 @@ export default {
}
]
},
getLinkClass(item) {
return ['p-menuitem-link', {'p-disabled': item.disabled}];
},
bindDocumentClickListener() {
if (!this.documentClickListener) {
this.documentClickListener = (event) => {