How can I call a function when a prop is updated?
parent container:
<div>
<Maintable :type="typeRef" :country="countryRef" />
</div>
child container:
export default{
props: ['type'],
setup(props)
{
watch(props.type, () => {
console.log('hello')
})
}
this code gets an error: Invalid watch source... How can I listen for an update of tthe props?
Hope someone can help me out!! :-)