PrimeVue 3 DataTable not reactive?

UI Components for Vue
Post Reply
chacs
Posts: 3
Joined: 28 Nov 2020, 00:35

01 Dec 2020, 01:54

Code: Select all

<template>
    <DataTable :value="cars">
        <Column field="brand" header="Brand"></Column>
    </DataTable>
</template>

<script lang="ts">
import { defineComponent, ref } from "vue"
import DataTable from "primevue/components/datatable/DataTable"
import Column from "primevue/components/column/Column"

const CARS = [
    {brand: "Audi"}
]

export default defineComponent({
    components: {
        DataTable, Column
    },
    setup() {
        return {
            cars: ref(CARS)
        }
    },
    mounted() {
        CARS.push({brand: "BMW"})
    }
})
</script>
The table shows 1 row (Audi) but didn't show the 2nd row (BMW)

Any help? Thanks.

Eireternal
Posts: 6
Joined: 06 Nov 2020, 21:29

03 Dec 2020, 13:56

I too am running into this issue. Anyone know how to resolve?

ntgraph@yahoo.com
Posts: 3
Joined: 28 Nov 2020, 03:08

04 Dec 2020, 23:41

Me too, I am under the impression Vue 3 reactive breaks lots of UI library and components, not only Prime Vue, as soon as the data is fetched (not from original data) then component is reactive

ricombnation
Posts: 24
Joined: 11 Jan 2022, 10:54

15 Aug 2022, 13:45

Reactive table data (value prop) would really be useful.

Post Reply

Return to “PrimeVue”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests