pretty-checkbox-vue icon indicating copy to clipboard operation
pretty-checkbox-vue copied to clipboard

class p-default is incorrectly added when using only :class special bind

Open liqueurdetoile opened this issue 5 years ago • 2 comments

Hi,

When using only special class bind prop, the mounted hook doesn't detect that some classes have been provided and automatically apply p-default class. Therefore, some animations are disabled.

Here's a repro link : https://codepen.io/liqueurdetoile/pen/wvvZVaE

liqueurdetoile avatar Nov 23 '19 18:11 liqueurdetoile

Isn't that a pretty checkbox issue itself? Not from pretty checkbox vue?

marcosrocha85 avatar Nov 23 '19 22:11 marcosrocha85

@marcosrocha85 Nope. Issue is in mounted hook :

if (this.$vnode.data && !this.$vnode.data.staticClass)
                this.default_mode = true;

It only check for static classes to fallback on p-default class. It should also check for binded classes. I think this one could do the trick :

if (this.$vnode.data && !this.$vnode.data.staticClass && !this.$vnode.data.class)
                this.default_mode = true;

liqueurdetoile avatar Nov 24 '19 08:11 liqueurdetoile