If I set a var in setup
setup(props, context) {
let name = "Tommy";
}
Is it possible to set this so it can be used in the component?
data() {
return {
myName: name
}
},
I can access it in the template but not in any of the component methods. Even if I put it in the onMounted hook.
setup(props, context) {
onMounted(() => {
let name = "Tommy";
}
}