michitaro / vue-menu

Menu/Contextmenu Component for vue2
https://michitaro.github.io/vue-menu/
MIT License
263 stars 26 forks source link

Where is the proper position to set z-index for vue-menu #9

Closed frankxin closed 6 years ago

frankxin commented 6 years ago

Here is my case. image So I need set "z-index" to "Fixed element". And I have no idea how to set it without modifying "vue-menu" source code. Do you have any suggestion?

michitaro commented 6 years ago

Do you mean the red box is covering over the orange box, so you cannot click "Menuitem 4" and "Menuitem 5"?

frankxin commented 6 years ago

Yes. You got it~ @michitaro

michitaro commented 6 years ago

Adding style="position: relative; z-index: 999" to <hsc-menu-button-menu/> may solve the problem.

frankxin commented 6 years ago

It works. By the way, Your code is pretty GOOD. I learned a lot. Thx.

michitaro commented 6 years ago

Thats' good!

frankxin commented 6 years ago

@michitaro I found an issue if you add style="position: relative; z-index: 999" to <hsc-menu-button-menu/>. This means you apply z-index to your trigger element. This means you will change the z-index of your original trigger dom element. This may cause some problems.

frankxin commented 6 years ago

May cause problem like this one

image

michitaro commented 6 years ago

ver. 2.8 accepts property menuZIndex like this. Update vue-menu and remove style="position: relative; z-index: 999" from your codes.

frankxin commented 6 years ago

That's great, Thx.