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

248
Vistas
TypeError: Cannot read properties of null (reading 'subTree')

What does this error mean?

error message

this happens when I put my filteredData variable inside the tr tag of the table.

  <table id="table">
    <tr>
      <th>First name</th>
      <th>Last Name</th>
      <th>Email</th>
      <th>Original email</th>
      <th>Actions</th>
    </tr>
    <template>
      <tr v-if="(fiteredData = '')">
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
      </tr>
      <tr
        v-else
        v-for="data in filteredData"
        :key="data.ind_id"
        :value="data.ind_id"
      >
        <td>{{ data.first_name }}</td>
        <td>{{ data.last_name }}</td>
        <td>{{ data.email }}</td>
        <td>{{ data.email }}</td>
        <td>
          <button @click="sendProps(data)">
            <i class="fa-regular fa-edit" aria-hidden="true"></i>
          </button>
        </td>
      </tr>
    </template>
  </table>

This is my method:

  data() {
    return {
      fetchedData: "",
      filteredData: "",
    };
  },
  methods: {
    searchResult(e) {
      this.filteredData = this.fetchedData.filter((data) => {
        return data.email.toLowerCase().includes(this.email.toLowerCase());
      });
      e.preventDefault();
      console.log(this.filteredData);
    }

fetchedData get the data from this:

  async mounted() {
    await axios.get("http://localhost:5000/individuals").then((result) => {
      this.fetchedData = result.data;
      console.log(this.fetchedData);
    });
  },
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I am guessing this: <tr v-if="(filteredData = '')"> should be: <tr v-if="filteredData === ''">, or even beter: v-if="!filteredData.length". You've misspelled the variable name and are accidentally setting it to an empty string rather than doing a comparison (we've all been there, I'm sure)

On a related note, I would initialize fetchedData and filteredData as empty arrays, not strings, because v-for is meant to iterate over objects and arrays, not strings (even though it's probably smart enough to handle it).

about 4 years ago · Juan Pablo Isaza Denunciar
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