Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

127
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda