New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add customClass props to Skeletons #3642
Conversation
@GMartigny why did you move to template rendering? |
Because functional didn't serve any purpose here and all the rest of the lib is template. But of course, it can be reverted if you think it's out of scope for this PR. |
And Functional are great in Vue 2 for a component without state and there are benchmarks in the web that show rendering improvements. |
This is indeed need to be explicit with functional rendering.
Didn't know, thanks for the infos. However, I still find it quite hard to parse for a human. I took the liberty to spread the whole data coming from the context ( |
Ok! |
src/components/skeleton/Skeleton.vue
Outdated
staticClass: 'b-skeleton', | ||
class: [ context.props.size, context.props.position, { 'is-animated': context.props.animated } ] | ||
class: [ context.data.attrs.class, context.props.size, context.props.position, { 'is-animated': context.props.animated } ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sur is it ok? I usually use .staticClass
and not .class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know the proper way to test this ?
If I do :
wrapper = mount(BSkeleton, {
attrs: {
class: 'custom-class'
}
})
I don't have staticClass
set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean in the core code, you should use context.data.attrs.statiClass
instead of context.data.attrs.class
Hi ! Is there any update on this @GMartigny ? It would be cool to be able to pass classes and styles to the component |
Honestly, I don't know how to do it properly in the functional way (especially with testing). Maybe @jtommy or someone else could finish this up. |
As i told you https://github.com/buefy/buefy/pull/3642/files#r794054499, did you try it? |
@GMartigny any news? |
As I said in my previous comment, I'm not familiar with Vue functionnal rendering. I tried your suggestion, but I'm not able to properly test it. If i use |
This PR has been migrated to a feature request discussion. Please see #3976 for reference. |
Proposed Changes
customClass
prop to Skeletons<template>
rendering instead of functionnal