0
I’m trying to pass data from one component to another using the $bus method:
Vue.component('porcentagens',{
data: function(){
return {
porcentagemSangramentoMarginal: 0,
porcentagemPlaca: 0,
porcentagemOLeary: 0,
selecionadosSangramentoMarginal: [],
selecionadosPlaca: [],
selecionadosPorcentagemOLeary: []
}
},
created(){
this.$bus.$on('faceSelecionada', function(idFaceSelecionada){
if(idFaceSelecionada.charAt(0) == 's'){
}
})
},
He is listening to the event 'faceSelected' normally and receiving the parameter too, but I cannot access the data of the component itself: when receiving the event with parameter I need to add the received id in the list within date and change the value that is also contained in date, but it cannot access it at all, I tried using this and $.
Try to use Lifecycle
mounted
in place ofcreated
– Giovane