(function(){
/* сюда весь ваш код(который выше привели) */
}())<transition appear v-on:before-enter="beforeEnter" v-on:enter="enter">document.querySelectorAll('.block1').forEach(function (el,id) {
el.addEventListener('click',function () {
document.querySelectorAll('.block2')[id].classList.remove('active');
})
})beforeRouteLeave (to, from, next) {
/* Тут то что должно произойти перед закрытием страницы */
this.beforeLeave = false;
next();
},data: function(){
return{
beforeLeave: true,
}
},class="project-main_slider" v-if="beforeLeave"<transition>
</transition>