diff --git a/src/components/mdMenu/mdMenu.scss b/src/components/mdMenu/mdMenu.scss index 8cb98ab..29d3583 100644 --- a/src/components/mdMenu/mdMenu.scss +++ b/src/components/mdMenu/mdMenu.scss @@ -16,6 +16,7 @@ $menu-base-width: 56px; overflow-y: auto; position: fixed; z-index: 120; + clip-path: inset(-8px 10% 16% -8px); background-color: #fff; border-radius: 2px; filter: drop-shadow(0 1px 1px rgba(#000, $shadow-key-umbra-opacity)) @@ -42,7 +43,7 @@ $menu-base-width: 56px; &.md-direction-top-right { margin-top: 11px; margin-left: -8px; - clip-path: inset(-8px 16% -8px 10%); + clip-path: inset(16% 10% -8px -8px); } &.md-direction-top-left { diff --git a/src/components/mdMenu/mdMenu.vue b/src/components/mdMenu/mdMenu.vue index 2df9ee6..62f7dc1 100644 --- a/src/components/mdMenu/mdMenu.vue +++ b/src/components/mdMenu/mdMenu.vue @@ -112,21 +112,10 @@ calculateMenuContentPos() { let position; - switch (this.mdDirection) { - case 'bottom left': - position = this.getPosition('bottom', 'left'); - break; - - case 'top left': - position = this.getPosition('top', 'left'); - break; - - case 'top right': - position = this.getPosition('top', 'right'); - break; - - default: - position = this.getPosition('bottom', 'right'); + if (!this.mdDirection) { + position = this.getPosition('bottom', 'right'); + } else { + position = this.getPosition.apply(this, this.mdDirection.trim().split(' ')); } position = getInViewPosition(this.menuContent, position);