Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(VDataTable): emit current items immediately #20449

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

J-Sek
Copy link
Contributor

@J-Sek J-Sek commented Sep 10, 2024

Description

Follow-up on a2f16f4 from 8 months ago. immediate: true was used in V2 (VData.ts - line 266), but it was not obvious from the wording in the documentation. I think it was not intentional to write watch without it.

fixes #20440

Markup:

<template>
  <v-data-table
    :headers="headers"
    :items="items"
    @update:current-items="console.log('current-items', $event)"
  />
</template>

<script setup>
  const headers = [
    { title: 'Vegetable', key: 'name' },
    { title: 'Calories', key: 'calories' },
    { title: 'Fat (g)', key: 'fat' },
    { title: 'Carbs (g)', key: 'carbs' },
    { title: 'Protein (g)', key: 'protein' },
  ]
  const items = Array.from({ length: 50 }).map((_, i) => ({
    name: `Item #${i}`,
    calories: (Math.random() * 300).toFixed(),
    fat: (Math.random() * 60).toFixed(1),
    carbs: (Math.random() * 100).toFixed(),
    protein: (Math.random() * 40).toFixed(),
  }))
</script>

@Kinco-dev
Copy link

Thanks @J-Sek
Hope it will be published soon

@MajesticPotatoe MajesticPotatoe added T: bug Functionality that does not work as intended/expected C: VDataTable VDatatable labels Oct 28, 2024
@MajesticPotatoe MajesticPotatoe changed the title fix(VDataTable,VDataIterator): emit current items immediately fix(VDataTable): emit current items immediately Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VDataTable VDatatable T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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