Level 50
I can't see v-for here. where u used v-for?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
hello
I have experienced an error v-for require key
vue template
<li>
<div class="text-center see-all-notifications">
<a href="notifications.html">
<strong>See All Alerts</strong>
<i class="fa fa-angle-right"></i>
</a>
<div>No notifications</div>
</div>
</li>
</ul>
script import VueTimeago from 'vue-timeago'
Vue.use(VueTimeago, {
name: 'timeago',
locale: 'en-US',
locales: {
'en-US': require('vue-timeago/locales/en-US.json')
}
})
export default {
props:['user_id'],
data(){
return {
notifications: []
}
},
mounted() {
Echo.channel('order-tracker')
.listen('OrderStatusChanged', (booking) => {
if(this.user_id == booking.user_id){
this.notifications.unshift({
description: 'Booking ID: ' + booking.id + ' updated',
url: '/bookings/' + booking.id,
time: new Date()
})
}
});
}
}
help me thax
try this please
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<i class="fa fa-bell"></i>
<span class="notification-count label label-danger"></span>
<span class="caret"></span>
</a>
<ul class="dropdown-menu dropdown-menu-notifications" role="menu">
<li v-for="(notification,index) in notifications" :key="index">
<a :href="notification.url" >
<div>
<i class="fa fa-exclamation-circle fa-fw"></i> {{notification.description}}
<span class="pull-right text-muted small"><timeago :since="notification.time" :auto-update="5"></timeago></span>
</div>
</a>
<div class="divider"></div>
</li>
<li>
<div class="text-center see-all-notifications">
<a href="notifications.html">
<strong>See All Alerts</strong>
<i class="fa fa-angle-right"></i>
</a>
<div>No notifications</div>
</div>
</li>
</ul>
</li>
Please or to participate in this conversation.