Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

126
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda