problem description
want to do the transition effect, but css can not complete, because you need to calculate the number of child elements, so use the js of transition, they have several default events, I want to bring the number of child elements in, but found that this number covers all the parameters, I would like to ask what to do.
related codes
/ / Please paste the code text below (do not replace the code with pictures)
<transition @before-enter="bEnter(item1.children.length)" @enter="enter" @leave="leave">
bEnter(el){ //el
console.log(arguments)
el.style.height = 0;
el.style.opacity = 0;
}
what result do you expect? What is the error message actually seen?
although it can be used by clicking to record the number of length, it is more convenient to use parameters. I want to know how to use this place so that it does not replace the default parameters of the event function.