0👍
I don’t think there is much of a noticeable difference unless you benchmark it.
If this matters to you, you could choose to not have the appear
handler by passing a dynamic object to v-on
instead.
<transition ... v-on="transitionEventHandlers">
JS
data: {
shouldUseAppearHandler: true
},
computed: {
transitionEventHandlers() {
let handlers = {
enter: this.doEnter
};
if(this.shouldUseAppearHandler) {
handlers = {
appear: this.doAppear,
...handlers
}
}
return handlers;
}
},
methods: {
doEnter() {
console.log("enter");
},
doAppear() {
console.log("appear");
}
}
example: https://codepen.io/jacobgoh101/pen/aGVzjR?editors=1011
- [Vuejs]-Vue.js transitions: animate height while using slide out animation
- [Vuejs]-How to downgrade Vue CLI 3.12.0 to 3.0.1
Source:stackexchange.com