<template>
<component :is="forms[activeComponent]" @formName = 'changeForm' />
<router-link to="/">Go to Home</router-link>
</template>
<script setup>
import LoginForm from '../components/forms/auth/LoginForm.vue'
import RegisterForm from '../components/forms/auth/RegisterForm.vue'
import { ref, watch } from 'vue'
const forms = {
LoginForm,
RegisterForm
}
let activeComponent = ref('LoginForm')
const changeForm = (val) => {
//console.log(val)
activeComponent = val
//console.log(activeComponent)
}
watch(activeComponent, (activeComponentNew) => {
console.log(activeComponentNew)
})
</script>
P.S. Если это ты) большое тебе спасибо за твой блог, с него я начал свой путь еще с Drupal 7!