I have the next code:
HTML:
<p @click="changeForm">Iniciar sesion</p>
JS
export default {
name: "Register",
props: {
changeForm: Function,
},
setup() {
//How can i call props changeForm here???
}
}
How can i call my props function from JS? The other way around is to trigger click on my p element, is that possible?
I am using vue 3. I have tested with this.changeForm and props.changeForm with no luck.
The setup
function receives props
as its first argument:
export default {
name: "Register",
props: {
changeForm: Function,
},
setup(props) { // receive `props` argument
props.changeForm(); // use it to access `changeForm`
}
}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments