michitaro / vue-menu

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

Injected CSS Styles Aren't Prefixed #3

Open michael-hawker opened 6 years ago

michael-hawker commented 6 years ago

I needed to adjust the context menu's z-index, as one of my other components had a non-standard z-index greater than zero (you probably want a high z-index to begin with).

I noticed that I could fix this by adding to the .fixed CSS class in my own stylesheet, but that's a pretty common name. Since the library is injecting its own styles, they should be prefixed with the library name so that there's less chance for collisions with the styles of whoever's consuming it.

e.g. use .hsc-menu-fixed here

michitaro commented 6 years ago

I missed putting a necessary "scoped" property. https://github.com/michitaro/vue-menu/commit/bde85e6e1bbf2a51635d9d4521d8170ec25dbf64

I hope fix the problem.