When I log in, I want to activate the like button.
To do that, I used the event bus and checked to see if I was logged in successfully.
But the like button is not activated.
It should return a true value when logged in, but it can't.
How can I return true?
I am using javascript and vue.
<template>
<div>
<b-button
:disabled="!validateForm"
v-b-tooltip.hover.topleft.v-danger title="좋아요 누른 게시물" placement = "bottom"
v-on:click="[on(), showlist()] "
class="goodlist-btn"
pill variant="outline-danger"
style="box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;">
<b-icon icon="heart-fill" ></b-icon>
</b-button>
</div>
</template>
<script>
import {EventBus} from '../lib/event-bus.js'
import Vue from 'vue'
export default {
name: 'likelist-btn',
computed: {
validateForm: function () {
Vue.prototype.$firebaseAuth.eventBus.$on('onAuthStateChanged', (isLoggedIn) => {
if (isLoggedIn) {
console.log('login ok: ' + isLoggedIn)
return true //I should get this value returned.
} else {
console.log('login no: ' + isLoggedIn)
return false //I should get this value returned.
}
})
}
}
}
</script>