[Vuejs]-Use V-IF to show button only when a value from Firestore is true

1👍

The answer was simple and I just had a small mistake, I used users.Alarm instead of user.Alarm. From the v-for. Thanks for your answers though it helped me figure out what I did wrong. Apologies!

👤Yewla

0👍

You are not setting the relevant data after getting the API response. I think you should set safety, battery and alarm value in callback. like this ..

querySnapshot.forEach(doc => {
      const data = {
        id: doc.id,
        Safety: doc.data().Safety,
        Alarm: doc.data().Alarm,
        Battery: doc.data().Battery,
      };
       this.users.push(data);
       this.safety = doc.data().Safety;
       this.battery = doc.data().Battery;
       this.alarm = doc.data().Alarm;

    });

Leave a comment