vue icon indicating copy to clipboard operation
vue copied to clipboard

Feat/show important directive

Open ajomuch92 opened this issue 2 years ago • 4 comments

Adding support for important modifier on v-show directive

  • [ ] Bugfix
  • [x] Feature
  • [ ] Code style update
  • [ ] Refactor
  • [ ] Build-related changes
  • [ ] Other, please describe:

Does this PR introduce a breaking change?

  • [ ] Yes
  • [x] No

The PR fulfills these requirements:

  • [ ] It's submitted to the main branch for v2.x (or to a previous version branch)
  • [ ] When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)
  • [x] All tests are passing: https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#development-setup
  • [x] New/updated tests are included

The explanation to include this feature is when you have a component (from an external library or own component) and this component has a display flex (or other display property on CSS), the v-show directive doesn't work showing the content you are trying to hide/show. You can make a workaround, like switching the class with the condition used into the directive, but it could be easier for developers only add this modifier

ajomuch92 avatar Jan 24 '23 14:01 ajomuch92

Did you see this idea was already rejected at https://github.com/vuejs/vue/issues/3761 ?

posva avatar Jan 24 '23 14:01 posva

@posva Yes, I read that issue, but I think this is relevant, because I have met with this problem many times, and other devs faced this too.

I think it's not big deal to implement it, another library did it

ajomuch92 avatar Jan 24 '23 15:01 ajomuch92

@posva Also, if we implement a custom directive to display none important, this new one doesn't trigger the transition classes (if it's wrapped by a transition component), keep in mind

ajomuch92 avatar Jan 24 '23 16:01 ajomuch92

@posva any news from this PR?

ajomuch92 avatar Apr 25 '23 19:04 ajomuch92