mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Components added. Build issues fixed
This commit is contained in:
parent
5b66ed1093
commit
18c3721848
344 changed files with 12446 additions and 8758 deletions
|
@ -1,15 +1,15 @@
|
|||
<template>
|
||||
<li :class="containerClass(item)" v-if="visible()">
|
||||
<li v-if="visible()" :class="containerClass(item)">
|
||||
<template v-if="!template">
|
||||
<router-link v-if="item.to" :to="item.to" custom v-slot="{navigate, href, isActive, isExactActive}">
|
||||
<a :href="href" :class="linkClass({isActive, isExactActive})" @click="onClick($event, navigate)">
|
||||
<router-link v-if="item.to" v-slot="{ navigate, href, isActive, isExactActive }" :to="item.to" custom>
|
||||
<a :href="href" :class="linkClass({ isActive, isExactActive })" @click="onClick($event, navigate)">
|
||||
<span v-if="item.icon" :class="iconClass"></span>
|
||||
<span v-if="item.label" class="p-menuitem-text">{{label()}}</span>
|
||||
<span v-if="item.label" class="p-menuitem-text">{{ label() }}</span>
|
||||
</a>
|
||||
</router-link>
|
||||
<a v-else :href="item.url||'#'" :class="linkClass()" @click="onClick" :target="item.target">
|
||||
<a v-else :href="item.url || '#'" :class="linkClass()" @click="onClick" :target="item.target">
|
||||
<span v-if="item.icon" :class="iconClass"></span>
|
||||
<span v-if="item.label" class="p-menuitem-text">{{label()}}</span>
|
||||
<span v-if="item.label" class="p-menuitem-text">{{ label() }}</span>
|
||||
</a>
|
||||
</template>
|
||||
<component v-else :is="template" :item="item"></component>
|
||||
|
@ -38,22 +38,25 @@ export default {
|
|||
}
|
||||
},
|
||||
containerClass(item) {
|
||||
return [{'p-disabled': this.disabled(item)}, this.item.class];
|
||||
return [{ 'p-disabled': this.disabled(item) }, this.item.class];
|
||||
},
|
||||
linkClass(routerProps) {
|
||||
return ['p-menuitem-link', {
|
||||
'router-link-active': routerProps && routerProps.isActive,
|
||||
'router-link-active-exact': this.exact && routerProps && routerProps.isExactActive
|
||||
}];
|
||||
return [
|
||||
'p-menuitem-link',
|
||||
{
|
||||
'router-link-active': routerProps && routerProps.isActive,
|
||||
'router-link-active-exact': this.exact && routerProps && routerProps.isExactActive
|
||||
}
|
||||
];
|
||||
},
|
||||
visible() {
|
||||
return (typeof this.item.visible === 'function' ? this.item.visible() : this.item.visible !== false);
|
||||
return typeof this.item.visible === 'function' ? this.item.visible() : this.item.visible !== false;
|
||||
},
|
||||
disabled(item) {
|
||||
return (typeof item.disabled === 'function' ? item.disabled() : item.disabled);
|
||||
return typeof item.disabled === 'function' ? item.disabled() : item.disabled;
|
||||
},
|
||||
label() {
|
||||
return (typeof this.item.label === 'function' ? this.item.label() : this.item.label);
|
||||
return typeof this.item.label === 'function' ? this.item.label() : this.item.label;
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -61,5 +64,5 @@ export default {
|
|||
return ['p-menuitem-icon', this.item.icon];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue