parent
fb962d7937
commit
0007663991
|
@ -242,6 +242,7 @@ export default {
|
||||||
padding: .25em;
|
padding: .25em;
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.p-contextmenu .p-menuitem-icon {
|
.p-contextmenu .p-menuitem-icon {
|
||||||
|
|
|
@ -4,13 +4,12 @@
|
||||||
<template v-for="(item, i) of model">
|
<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"
|
<li role="none" :class="getItemClass(item)" :style="item.style" v-if="item.visible !== false && !item.separator" :key="item.label + i"
|
||||||
@mouseenter="onItemMouseEnter($event, item)">
|
@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)" role="menuitem">
|
||||||
@click.native="onItemClick($event, item)" role="menuitem">
|
|
||||||
<span :class="['p-menuitem-icon', item.icon]"></span>
|
<span :class="['p-menuitem-icon', item.icon]"></span>
|
||||||
<span class="p-menuitem-text">{{item.label}}</span>
|
<span class="p-menuitem-text">{{item.label}}</span>
|
||||||
</router-link>
|
</router-link>
|
||||||
<a v-else :href="item.url||'#'" class="p-menuitem-link" :target="item.target"
|
<a v-else :href="item.url" :class="getLinkClass(item)" :target="item.target" @click="onItemClick($event, item)"
|
||||||
@click="onItemClick($event, item)" :aria-haspopup="item.items != null" :aria-expanded="item === activeItem" role="menuitem">
|
: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-icon', item.icon]"></span>
|
||||||
<span class="p-menuitem-text">{{item.label}}</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>
|
<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,
|
'p-disabled': item.disabled,
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
getLinkClass(item) {
|
||||||
|
return ['p-menuitem-link', {'p-disabled': item.disabled}];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
|
@ -49,6 +49,7 @@ export default {
|
||||||
padding: .25em;
|
padding: .25em;
|
||||||
position: relative;
|
position: relative;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.p-menubar .p-menuitem-icon {
|
.p-menubar .p-menuitem-icon {
|
||||||
|
|
|
@ -3,13 +3,13 @@
|
||||||
<template v-for="(item, i) of model">
|
<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"
|
<li role="none" :class="getItemClass(item)" :style="item.style" v-if="item.visible !== false && !item.separator" :key="item.label + i"
|
||||||
@mouseenter="onItemMouseEnter($event, item)">
|
@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">
|
@click.native="onItemClick($event, item)" @keydown.native="onItemKeyDown($event, item)" role="menuitem">
|
||||||
<span :class="['p-menuitem-icon', item.icon]"></span>
|
<span :class="['p-menuitem-icon', item.icon]"></span>
|
||||||
<span class="p-menuitem-text">{{item.label}}</span>
|
<span class="p-menuitem-text">{{item.label}}</span>
|
||||||
</router-link>
|
</router-link>
|
||||||
<a v-else :href="item.url||'#'" class="p-menuitem-link" :target="item.target" :aria-haspopup="item.items != null" :aria-expanded="item === activeItem"
|
<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">
|
@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-icon', item.icon]"></span>
|
||||||
<span class="p-menuitem-text">{{item.label}}</span>
|
<span class="p-menuitem-text">{{item.label}}</span>
|
||||||
<span :class="getSubmenuIcon()" v-if="item.items"></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() {
|
bindDocumentClickListener() {
|
||||||
if (!this.documentClickListener) {
|
if (!this.documentClickListener) {
|
||||||
this.documentClickListener = (event) => {
|
this.documentClickListener = (event) => {
|
||||||
|
|
|
@ -189,6 +189,7 @@ export default {
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.p-tieredmenu .p-menuitem-icon {
|
.p-tieredmenu .p-menuitem-icon {
|
||||||
|
|
|
@ -3,13 +3,13 @@
|
||||||
<template v-for="(item, i) of model">
|
<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"
|
<li :class="getItemClass(item)" :style="item.style" v-if="item.visible !== false && !item.separator" :key="item.label + i"
|
||||||
@mouseenter="onItemMouseEnter($event, item)" role="none">
|
@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">
|
@click.native="onItemClick($event, item)" @keydown.native="onItemKeyDown($event, item)" role="menuitem">
|
||||||
<span :class="['p-menuitem-icon', item.icon]"></span>
|
<span :class="['p-menuitem-icon', item.icon]"></span>
|
||||||
<span class="p-menuitem-text">{{item.label}}</span>
|
<span class="p-menuitem-text">{{item.label}}</span>
|
||||||
</router-link>
|
</router-link>
|
||||||
<a v-else :href="item.url||'#'" class="p-menuitem-link" :target="item.target" :aria-haspopup="item.items != null" :aria-expanded="item === activeItem"
|
<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">
|
@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-icon', item.icon]"></span>
|
||||||
<span class="p-menuitem-text">{{item.label}}</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>
|
<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() {
|
bindDocumentClickListener() {
|
||||||
if (!this.documentClickListener) {
|
if (!this.documentClickListener) {
|
||||||
this.documentClickListener = (event) => {
|
this.documentClickListener = (event) => {
|
||||||
|
|
Loading…
Reference in New Issue