pass props to data in vue from method code example
Example: pass method as props vue
//You should probably not pass methods as props in Vue, instead, emit an event.
//In parent component, do for example:
methods: {
sayHi() {
alert('Hi')
}
}
// In child component, do:
methods: {
doSomething() {
this.$emit('alert')
}
}