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: vue table example #887

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions examples/vue/table/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@
</thead>
<tbody>
<tr
v-for="virtualRow in virtualRows"
v-for="(virtualRow, index) in virtualRows"
:key="virtualRow.key"
:style="{ transform: `translateY(${virtualRow.start}px)` }"
:style="{
transform: `translateY(${virtualRow.start - index * virtualRow.size}px)`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm this looks wrong, start should be calculated correctly

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about what you're suggesting.

The calculation looks correct and that's the same with React version. I tested with this: https://stackblitz.com/github/tuanalumi/virtual/tree/main/examples/vue/table?embed=1&theme=light&preset=node&file=src/App.vue

}"
>
<td
v-for="cell in rows[virtualRow.index].getVisibleCells()"
Expand Down