submenu arrow

This commit is contained in:
Evert Prants 2023-06-09 22:48:00 +03:00
parent 919cbba32f
commit 61b6e52403
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
2 changed files with 18 additions and 1 deletions

View File

@ -19,6 +19,7 @@
:id="item.id"
:items="item.children"
trigger="hover"
submenu
:position="position"
:disabled="item.disabled"
>{{ item.label }}</Menu
@ -65,6 +66,7 @@ const props = withDefaults(
openSibling?: string;
open?: boolean;
disabled?: boolean;
submenu?: boolean;
}>(),
{
position: 'bottom',
@ -89,6 +91,7 @@ const menuClass = computed(() => [
'menu-wrapper',
isOpen.value ? 'menu-wrapper--open' : 'menu-wrapper--closed',
`menu-wrapper--${props.position}`,
props.submenu ? 'menu-wrapper--submenu' : '',
]);
const menuStyle = computed(() =>
@ -162,6 +165,18 @@ watch(
right: 100%;
}
&.menu-wrapper--submenu > .menu-button::after {
content: '';
position: absolute;
width: 0;
height: 0;
border-top: 0.375rem solid transparent;
border-bottom: 0.375rem solid transparent;
border-left: 0.375rem solid rgb(87, 87, 87);
right: 0.25rem;
top: 0.6875rem;
}
&--open > .menu-button {
background-color: #e6e6e6;
}

View File

@ -137,7 +137,9 @@ const menuItems = computed(() => [
{
id: 'add',
label: 'Add...',
disabled: (props.item as GameObject).virtual,
disabled:
(props.item as GameObject).virtual &&
(props.item as GameObject).objectType !== 'World',
children: Object.keys(instancableGameObjects).map((item) => ({
id: item,
label: item,