Why is the filter
method not working with this.userId
, but it is working with the hard-coded value "admin"
? How can I resolve this issue?
computed: {
UidMessages: function() {
return this.Messages.filter(function(m) {
return m.to == this.userId;
})
}
},
The code that is currently working:
computed: {
AMesseg: function() {
return this.Messages.filter(function(m) {
return m.to== "admin";
})
}
},
I suspect the problem lies in the comparison of strings.
Thank you.