Closed de-soul closed 1 year ago
In additional, i see that this problem can be resolved, if changed properties values from new items object with that set in item-value
property of v-data-table. For example, if my items is [{id: 1, name: "Test 1", someName: "Test 1"},{id: 2, name: "Test 2", someName: "Test 2"}] and v-data-table property item-value="someName"
, then v-data-table will not reflects on items change if changed property name is id
or someName
. Only change value of name
item property in new items list will affects on v-data-table showing values.
As temporary bug fix, problem can be solved by forced recreation of v-data-table component
Solution
const bugFixKey=ref(1);
bugFixKey
ref as key property of v-data-table:
<v-data-table
:key="`datatable-${bugFixKey}`"
v-model="selectedRows"
:items="items"
:headers="headers"
:search="search"
show-select
>
key
of v-data-table object by changing its value: bugFixKey = bugFixKey + 1
Please create a minimal reproduction for this issue, preferably using https://play.vuetifyjs.com/. I'm not going to debug your entire project for you.
Please create a minimal reproduction for this issue, preferably using https://play.vuetifyjs.com/. I'm not going to debug your entire project for you.
I created project on vuetify play here but problem not occurs... Possible the problem exist on my origins project is because i used pinia there and composables as storage at vuetify play (because i cant init pinia there).
Sounds like you have a reactivity problem then, not related to vuetify.,
Hello, is the problem solved? When deleting a record and reloading the items, the record is still visible, the table is not refreshed
Environment
Vuetify Version: 3.1.6 Vue Version: 3.2.47 Browsers: Firefox 110.0 OS: Windows 10
Steps to reproduce
{ "id": 87, "name": "Test 1", "createdAt": "2023-02-28T14:44:54.117Z", "updatedAt": "2023-02-28T17:16:04.166Z" }
from "Test 1" to "Test 123"Expected Behavior
Expected force recreation of v-data-table on items values changed
Actual Behavior
v-data-table showing correct items values only after sorting button pressed
Reproduction Link
https://github.com/de-soul/nuxt3-strapi-starter
Other comments
You can get my tomorrow commit in attached github repository. Problem affects two files: https://github.com/de-soul/nuxt3-strapi-starter/blob/master/frontend/components/crud/Datatable.vue and https://github.com/de-soul/nuxt3-strapi-starter/blob/master/frontend/stores/sqlmanager.js . The first file is template where v-data-table and computed items object are defined. Second one file is the store file, contained items data