mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-08 16:37:15 +00:00
Refactor #3965 - Update Base components
This commit is contained in:
parent
b6ec58de65
commit
751295c755
27 changed files with 279 additions and 377 deletions
|
@ -37,26 +37,26 @@ const classes = {
|
|||
submenuHeader: 'p-submenu-header',
|
||||
separator: 'p-menuitem-separator',
|
||||
end: 'p-menu-end',
|
||||
menuitem: ({ context }) => [
|
||||
menuitem: ({ instance }) => [
|
||||
'p-menuitem',
|
||||
{
|
||||
'p-focus': context.id === context.focusedOptionId,
|
||||
'p-disabled': context.disabled()
|
||||
'p-focus': instance.id === instance.focusedOptionId,
|
||||
'p-disabled': instance.disabled()
|
||||
}
|
||||
],
|
||||
content: 'p-menuitem-content',
|
||||
action: ({ context, isActive, isExactActive }) => [
|
||||
action: ({ instance, isActive, isExactActive }) => [
|
||||
'p-menuitem-link',
|
||||
{
|
||||
'router-link-active': isActive,
|
||||
'router-link-active-exact': context.exact && isExactActive
|
||||
'router-link-active-exact': instance.exact && isExactActive
|
||||
}
|
||||
],
|
||||
icon: 'p-menuitem-icon',
|
||||
label: 'p-menuitem-text'
|
||||
};
|
||||
|
||||
const { load: loadStyle, unload: unloadStyle } = useStyle(styles, { id: 'primevue_menu_style', manual: true });
|
||||
const { load: loadStyle } = useStyle(styles, { id: 'primevue_menu_style', manual: true });
|
||||
|
||||
export default {
|
||||
name: 'BaseMenu',
|
||||
|
@ -100,15 +100,13 @@ export default {
|
|||
}
|
||||
},
|
||||
css: {
|
||||
classes
|
||||
classes,
|
||||
loadStyle
|
||||
},
|
||||
watch: {
|
||||
isUnstyled: {
|
||||
immediate: true,
|
||||
handler(newValue) {
|
||||
!newValue && loadStyle();
|
||||
}
|
||||
}
|
||||
provide() {
|
||||
return {
|
||||
$parentInstance: this
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue