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

973
Views
v-for loop throws Uncaught TypeError: row.children.default is not a function

I'm using Vue3 with PrimeVue and want to create dynamic table header sections based on a config file. I modified the sample code from the docs for column groups https://primefaces.org/primevue/showcase/#/datatable/colgroup .

When hardcoding headers everything is fine

<template>
  <div id="app">
    <p-data-table>
      <p-column-group type="header">
        <p-row>
          <p-column header="Section 1" :rowspan="4" :colspan="1" />
          <p-column header="Section 2" :rowspan="1" :colspan="2" />
          <p-column header="Section 3" :rowspan="1" :colspan="3" />
          <p-column header="Section 4" :rowspan="1" :colspan="1" />
        </p-row>
        <p-row>
          <p-column header="Section 2.1" :rowspan="3" :colspan="1" />
          <p-column header="Section 2.2" :rowspan="3" :colspan="1" />
          <p-column header="Section 3.1" :rowspan="3" :colspan="1" />
          <p-column header="Section 3.2" :rowspan="1" :colspan="2" />
          <p-column header="Section 4.1" :rowspan="1" :colspan="1" />
        </p-row>
        <p-row>
          <p-column header="Section 3.2.1" :rowspan="2" :colspan="1" />
          <p-column header="Section 3.2.2" :rowspan="2" :colspan="1" />
          <p-column header="Section 4.1.1" :rowspan="1" :colspan="1" />
        </p-row>
        <p-row>
          <p-column header="Section 4.1.1.1" :rowspan="1" :colspan="1" />
        </p-row>
      </p-column-group>
    </p-data-table>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from "vue";
import DataTable from "primevue/datatable";
import Column from "primevue/column";
import Row from "primevue/row";
import ColumnGroup from "primevue/columngroup";

export default defineComponent({
  components: {
    "p-data-table": DataTable,
    "p-column": Column,
    "p-row": Row,
    "p-column-group": ColumnGroup,
  }
});
</script>

The generated output is as expected

enter image description here

You can see the working live demo here

When trying to load the hardcoded headers from code like so

<template>
  <div id="app">
    <p-data-table>
      <p-column-group type="header">
        <p-row
          v-for="(columnHeaderRow, columnHeaderRowIndex) in columnHeaderRows"
          :key="`columnHeaderRow-${columnHeaderRowIndex}`"
        >
          <p-column
            v-for="(columnHeader, columnHeaderIndex) in columnHeaderRow"
            :key="`columnHeader-${columnHeaderIndex}`"
            :header="columnHeader.header"
            :rowspan="columnHeader.rowspan"
            :colspan="columnHeader.colspan"
          />
        </p-row>
      </p-column-group>
    </p-data-table>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from "vue";
import DataTable from "primevue/datatable";
import Column from "primevue/column";
import Row from "primevue/row";
import ColumnGroup from "primevue/columngroup";

export default defineComponent({
  components: {
    "p-data-table": DataTable,
    "p-column": Column,
    "p-row": Row,
    "p-column-group": ColumnGroup,
  },
  setup() {
    const columnHeaderRows = ref([
      [
        { header: "Section 1", rowspan: "4", colspan: "1" },
        { header: "Section 2", rowspan: "1", colspan: "2" },
        { header: "Section 3", rowspan: "1", colspan: "3" },
        { header: "Section 4", rowspan: "1", colspan: "1" },
      ],
      [
        { header: "Section 2.1", rowspan: "3", colspan: "1" },
        { header: "Section 2.2", rowspan: "3", colspan: "1" },
        { header: "Section 3.1", rowspan: "3", colspan: "1" },
        { header: "Section 3.2", rowspan: "1", colspan: "2" },
        { header: "Section 4.1", rowspan: "1", colspan: "1" },
      ],
      [
        { header: "Section 3.2.1", rowspan: "2", colspan: "1" },
        { header: "Section 3.2.2", rowspan: "2", colspan: "1" },
        { header: "Section 4.1.1", rowspan: "1", colspan: "1" },
      ],
      [{ header: "Section 4.1.1.1", rowspan: "1", colspan: "1" }],
    ]);

    return { columnHeaderRows };
  },
});
</script>

I get the following error

Uncaught TypeError: row.children.default is not a function

enter image description here

You can see the demo showing the error here

Does someone know what's wrong and how to fix it?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Ok this is a known bug https://github.com/primefaces/primevue/issues/1630

and already fixed on master https://github.com/primefaces/primevue/commit/a51f26ce40ae4dc6df35a457f13a2d400604410a

over 4 years ago · Santiago Trujillo Report
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!