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

[vuetable v2.0] Re-render field component on page change #690

Open
bartversluijs opened this issue Aug 17, 2020 · 1 comment
Open

[vuetable v2.0] Re-render field component on page change #690

bartversluijs opened this issue Aug 17, 2020 · 1 comment

Comments

@bartversluijs
Copy link

Hi,

I need the new VuetableFieldMixin, so I'm using the next package. I've created some Field Components, and it does exactly what I want. However, there seems to be a bug in those components.

When I change pages, the component doesn't re-render. So row 1 of page 1 has the same data in the Field Components as row 1 of page 2. The mounted doesn't get triggered when going to page 2. (Weird side note, the mounted does get triggered when returning to page 1).

I was trying to add a key to the component, but that doesn't seem possible (based on the ID of the rowData).

Is there any way to listen to changes or just re-render the components on page change? This causes huge problems in our project at the moment.

Thanks in advance!

@bartversluijs
Copy link
Author

After typing this issue, I thought about the watch function of Vue.
So I used this:

watch: {
  rowData (row) {
    // Function to update the data
  }
}

This seems to work, however, it would be prettier if this worked out of the box instead having to create a watch function for every component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant