CyberNika / v-contextmenu

🖱 ContextMenu based on Vue 3 & Vue 2
https://cybernika.github.io/v-contextmenu/
MIT License
918 stars 112 forks source link

disabled属性与选择事件冲突 #52

Closed DerekMar closed 7 months ago

DerekMar commented 5 years ago

当我需要,点击contextmenu的指定项后,需要disable该项时,出现如下效果: image

期望结果

实际结果

我希望,当指定项无效时,应该去掉selected的效果

复现步骤

绑定 :disabled="!isDrawing",点击该项后,将 isDrawing = !isDrawing,会出现上述结果

环境说明

nanachiOwQ commented 5 years ago

不改代码只能加个css了.. css .v-contextmenu-item--disabled.v-contextmenu-item--hover{ color: #ccc; cursor: not-allowed; background: transparent !important; }

DerekMar commented 5 years ago

不改代码只能加个css了.. css .v-contextmenu-item--disabled.v-contextmenu-item--hover{ color: #ccc; cursor: not-allowed; background: transparent !important; }

我直接修改了源码,其实就是语句执行顺序换一下而已

nanachiOwQ commented 5 years ago

@DerekMar 是滴,disabled直接return了, 但是不想把代码拷到项目里- -

CyberNika commented 5 years ago

@DerekMar @dracarys26 可以考虑提个 PR 😋