Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[vue-table] Is there an option to use refs and computed with useVueTable? #5102

Unanswered
vojvodics asked this question in Q&A
Discussion options

I don't know if this is an issue with the adapter or the types, but it'd be awesome if the useVueTable had a more vue-like API. E.g. data should be of type MaybeRefOrGetter<TData>, which the adapter can then resolve to get data() { return toValue(options.data) }.

The usage of the table would be more natural in vue:
If you're creating a custom component:

useVueTable({
 data: () => props.data, // vue 3.3, or if using lower version computed(() => props.data)
 state: () => ({ ...your state }),
});

If using vue-query

const { data } = useQuery();
const table = useVueTable({ data });

*There is a related unanswered discussion (#4455) which probably highlights the confusion around the current vue-table API

You must be logged in to vote

Replies: 2 comments

Comment options

Bump I would like to have this feature as well

You must be logged in to vote
0 replies
Comment options

I have now created a PR which will add support for reactive data in the Vue-adapter: #5687

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /