1👍
It should be defined as a computed property since it depends on the value of the other property (do the same thing for name
) :
<script setup>
import { useAuth0 } from '@auth0/auth0-vue';
let auth0 = process.client ? useAuth0() : undefined;
const name = computed(()=>auth0?.isAuthenticated ? auth0?.user?.value.nickname:'');
const image = computed(()=>auth0?.isAuthenticated ? auth0?.user?.value.picture:'');
</script>
- [Vuejs]-Sending data to a non parent component in VueJs
- [Vuejs]-Is it possible to get Laravel user data from Vue JS?
Source:stackexchange.com