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

Vue Component Cell Update #185

Closed
rupertqin opened this issue Feb 27, 2021 · 1 comment
Closed

Vue Component Cell Update #185

rupertqin opened this issue Feb 27, 2021 · 1 comment
Labels
help wanted Extra attention is needed
Projects

Comments

@rupertqin
Copy link

https://codesandbox.io/s/revogrid-vuecomponent-forked-oz817

when I add more rows to it , then I click the buttons to increase the number to "5", scroll down, you see another cell is "5" too.

I think it's a bug of doing duplicate logic here.

@revolist
Copy link
Owner

revolist commented Mar 1, 2021

Hello @rupertqin
It's not an actual bug.

The thing is there is no object creation for each cell. Initially, Vue templates were introduced only for syntax sugar and it still recommended to use tsx/jsx template instead of vue.

How it works now:

  • We do not create vue vnode per each cell.
  • We actually update only properties data and as soon as a cell comes out of viewport it data gets replaced by another cell data but the component by itself still the same. Which provides a super performance.
    What you have to do you have to consider editing of row model instead of using data property.

I have provided you with sample in Codebox:
https://codesandbox.io/s/revogrid-vuecomponent-data-hzpqy

@revolist revolist closed this as completed Mar 1, 2021
@revolist revolist changed the title Cell as Vue component duplicates Vue Component Cell Update Mar 1, 2021
@revolist revolist added the help wanted Extra attention is needed label Mar 1, 2021
@revolist revolist pinned this issue Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
Revogrid
  
Awaiting triage
Development

No branches or pull requests

2 participants