Так что Vue добавляет объект в список объектов, но независимо от того, что я делаю, он не сортируется и не добавляется в начало списка.
набор происходит здесь
watch: {
sendBetData() {
// Creates the object to be appended to the list
const latest = {
bet_id: this.sendBetData.bet_id,
username: this.sendBetData.username,
bet: this.sendBetData.bet_amount,
client_seed: this.sendBetData.client_seed.seed,
created_at: this.sendBetData.created_at,
high: this.sendBetData.high,
multiplier: this.sendBetData.multiplier,
profit: this.sendBetData.profit,
result: this.sendBetData.result,
roll: this.sendBetData.roll_number,
server_seed: this.sendBetData.server_seed.seed_hash,
threshold: this.sendBetData.threshold,
user_id: this.sendBetData.user_id
};
this.$set(this.bets, latest.bet_id, latest)
},
},
тогда у меня есть вычисленная функция сортировки
computed: {
bets() {
console.log('yep');
return _.orderBy(this.bets, 'created_at')
}
},
Но что бы я ни пытался, он всегда устанавливает его в конец списка в представлении