This is the value to receive from the parent component
props: {
active: {
type: [String, Number],
default: 0,
}
},
Use the watch
pair active
to monitor the
value change will trigger the handler
method
watch: {
active: {
immediate: true,
handler(value) {
this.isAct = value
}
}
}
vue3
import {
watchEffect } from "vue";
setup(props, context) {
watchEffect(() => {
console.log(props)
})
},