I have a project where I'm writing Vue in TSX. I have created a custom directive such as "v-if" since when doing Vue in TSX, it's pretty low API and doesn't include all the directives as it would in SFC.
So my working directive looks like this:
const created = (el, binding) => {
if (binding.value) {
return el.hidden = false
} else {
return el.hidden = true
}
}
export default {
created
}
I am just curious to know when in the lifecycle v-if normally is initiated? Should I use mounted instead of created, perhaps?