Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

125
Views
Vue 3 render Firestore Data

I am stuck since a couple of days and tried to solve my problem without any result.

I am building a Vue 3 app and store data in a Firestore database. On a result page I want to display the data from the database.

getDBdata() {

const cuser = this.user.email;
console.log("cuser:", cuser)  
const q = query(collection(db, "testergebnisse"), where("email", "==", cuser));

const unsubscribe = onSnapshot(q, (querySnapshot) => {
const mitarbeiter = [];
querySnapshot.forEach((doc) => {
this.mitarbeiter.push({
 ...doc.data(),
 id: doc.id,
 testdate: moment(doc.data().testdatum.seconds).format("DD/MM/YYYY"),
 })
 mitarbeiter.push(doc.data().testdatum);
 });
 console.log("Current records: ", mitarbeiter);
 });

}

In the Template section I want to render the data:

<q-card v-for="use in mitarbeiter" :key="use.d" flat bordered class="my-card text-white"
      style="background: radial-gradient(circle, #35a2ff 0%, #014a88 100%)">
            <q-card-section>
        <div class="row items-center no-wrap">
          <div class="col">
            <div class="text-h6">Testergebnis Covid 19 Test</div>
            <div class="text-subtitle2">Testdatum: {{ use.testdate }}</div>
            <div class="text-subtitle2">Ergebnis: {{ use.testergebnis }}</div>
            <div class="text-subtitle2">Test Hersteller: {{ use.testhersteller }}</div>
            <div class="text-subtitle2">Test ID: {{ use.id }}</div>
          </div>
        </div>
      <span></span>
      </q-card-section>
      </q-card>

When I click the button I fire the function getDBdata() and I can see in the console that it actually gets the data from the database. But the data is not rendered in the DOM.

When I change the :key in the code the page reloads and also displays the data. I also tried to fire the function on created () without success.

I have no idea what else I can do. Any help highly appreciated.

Thanks and regards, Marc

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!