0👍
submit() {
if(this.username != "" && this.password != "") {
this.$emit("submit", this.username && this.password)
} else {
console.log("Not logged in")
}
}
In your parent component, you can listen for the submit event emitted by your child component like this:
<LoginForm @submit="handleSubmit" />
methods: {
handleSubmit(data) {
console.log(data)
}
}
- [Vuejs]-Some variable is undefined after deployment (Vue)
- [Vuejs]-How do I get Tailwind CSS to work with VueJS and Docker
Source:stackexchange.com