-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Description
Version
3.0.3
Reproduction link
https://codesandbox.io/s/vue-template-2omcj?fontsize=14&module=%2Fsrc%2FApp.vue
Steps to reproduce
See reproduction in sandbox for reference (see App.vue for relevant parts).
- Define default styles that only apply when another class is not applicable.
- Insert a with no classes defined.
- Observe that the default styles using not([class]) do not take effect.
What is expected?
When the link is inactive or does not match the current route no classes should be applied and the attribute should not exist on the rendered element.
What is actually happening?
No classes are being applied to the rendered element, but the class attribute still exists as it's included in the createElement call (class properties on data).
I'd prefer to not discuss whether or not the "not" selector should be used this way. It's a fairly reasonable expectation to have no class attribute on the element when classes aren't being applied.
If desired, I could submit a PR with a bugfix for this issue. From my limited experimentation, it seems fairly trivial to implement a fix.