I am facing an issue with my variable, transitionName, in the beforeLeaveHook function. Despite attempting to change it to 'left', the value remains stuck at 'right'. Any assistance on resolving this matter would be greatly appreciated.
<template lang="pug">
transition(:name="transitionName" v-on:before-leave="beforeLeaveHook")
.componentMain
h1 {{transitionName}}
</template>
<script>
export default {
name: 'Component',
data () {
return {
transitionName: 'right',
}
},
methods: {
beforeLeaveHook: function(event){
this.transitionName = 'left';
}
}
}
</script>