Closed donaldma closed 4 years ago
@donaldma thank you. I will check and fix it ;-)
So.. the problem is that .ps class is added by native js way in perfect scrollbar sources. Then Vue.js during generate classes for vnode and merge classes takes into account only vnode classes I mean staticClass and class - so these classes can be only added on vue component level. See more here https://github.com/vuejs/vue/blob/e90cc60c4718a69e2c919275a999b7370141f3bf/dist/vue.runtime.common.dev.js#L5484 and issue related with that -> https://github.com/vuejs/vue/issues/3975
But this is expected behaviour - so the better way is just add this class on component level. You can pull new version ;-)
Hey @mercs600 thanks for the quick response :)
The fix is exactly what I need but it seems like you haven't re-built the dist folder after the code change so it didn't propagate the change (can confirm this by adding your change inside the dist files)
Aww.. I'm sorry man, I forgot this repo has dist files, now it should be ok ;-)
Thanks a lot :)
Versions
vue2-perfect-scrollbar:
^1.2.1
vue:^2.6.8
Description
The default
.ps
class that is initialized byperfect-scrollbar
gets removed when I dynamically set other classes.Example vue code:
Example compiled code (initial):
Example compiled code (after a change triggers .largeScreen class to be added): *notice
.ps
gets removedMy hunch is that it has something to do with the actual v-bind:class from vue. This can be fixed in the mean time by ensuring
.ps
is always a static class on the root element of<perfect-scrollbar />
.