vue-sequential-entrance icon indicating copy to clipboard operation
vue-sequential-entrance copied to clipboard

Class support on render

Open EmmanuelBeziat opened this issue 4 years ago • 2 comments

I lack the ability to get a set of classes on the container. Here it is.

I tried the #2 option, but it didn't seem work.

EmmanuelBeziat avatar Nov 08 '19 05:11 EmmanuelBeziat

One sugestion for implement. I changed the code in localhost for test, and it's ok:

SequentialEntrance.js export default { functional: true, render(createElement, { props, data, children }) { let delay = props.delay || 250; let tag = props.tag || "span"; let contentClass = props.contentClass || ""; let animation = props.animation || "entranceFromRight";

if(props.fromTop != undefined) animation = 'entranceFromTop'
if(props.fromRight != undefined) animation = 'entranceFromRight'
if(props.fromBottom != undefined) animation = 'entranceFromBottom'
if(props.fromLeft != undefined) animation = 'entranceFromLeft'

if (children) {
  children.forEach((child, index) => {
    child.data.staticStyle = {
      opacity: 0,
      animationFillMode: "forwards",
      animationDelay: index * delay + "ms"
    };
    child.data.staticClass += " " + animation;
  });
}
return createElement(tag, {
  attrs: {
    class: contentClass
  }
}, children);

} };

jrglaber avatar Apr 01 '20 14:04 jrglaber

@deivthings any chances of this getting merged?

sandiprb avatar May 05 '20 11:05 sandiprb