[Vuejs]-How to update Vue component after it receives data

0👍

if eventIp is just one ip:

<div v-for="user in users">
    <div class="card-header">{{ user.ip }}</div>
    <div class="card-header">{{ user.name }}</div>
    <div v-if="ip==user.ip">online</div>
</div>

if eventIp includes multi online ip:

<div v-for="user in users">
    <div class="card-header">{{ user.ip }}</div>
    <div class="card-header">{{ user.name }}</div>
    <div v-for"userIp in ip">
      <span v-if="userIp==user.ip">online</span>
    </div>
</div>

updated:
as you explain in comments you need to listen channel. this link https://pusher.com/tutorials/todo-vue-laravel#building-vue-components is good section of a tutorial for this.

when new user created you need more data of new user in channel and add it to users variable. automatically vue render it in html.

Leave a comment