vuetifyjs / vuetify

🐉 Vue Component Framework
https://vuetifyjs.com
MIT License
39.9k stars 6.97k forks source link

[Bug Report][3.7.1] [VDataTable] update:currentItems event is not emitted on the first render #20440

Open vmihailenco opened 2 months ago

vmihailenco commented 2 months ago

Environment

Vuetify Version: 3.7.1 Last working version: 2.7.2 Vue Version: 3.5.3 Browsers: Chrome 128.0.0.0 OS: Linux x86_64

Steps to reproduce

  1. Run the example.
  2. There is no console.log until the pagination changes.

Expected Behavior

update:currentItems is emitted on component mount. Probably adding immediate: true to the watch is all that is needed. It used to work in Vuetify 2.

Actual Behavior

The initial update:currentItems event is not emitted until the data or pagination changes. It makes retrieving initial currentItems tricky.

Reproduction Link

https://play.vuetifyjs.com/#...

TIM56887 commented 2 months ago

I think it will cause render twice in SSR.