Hi all,
I’m struggling to display username in my VueJS app. I just can’t figure out how to reactively grab the character name, since Meteor will initiate loggingIn()
before the user is properly logged in.
For example:
<template>
<div class="top-bar">
<div class="avatar">
<span class="avatar-img"><img v-bind:src="charImage" /></span>{{ charName }}
</div>
</div>
</template>
<script>
export default {
name: 'topbar',
data: function() {
return {
charImage: '',
charName: ''
}
},
meteor: {
data: {
charName() {
if( !Meteor.user ) {
this.charName = 'Loading...';
} else {
this.charName = Meteor.user().profile.eveOnlineCharacterName;
}
}
}
}
}
</script>
This displays noting. In fact, it doesn’t even show Loading...
where I think it should. It was my understanding you put the reactive data in the meteor
block?
Any suggestions or examples of displaying this? To confirm, I’m definitely logged in.
Cheers!