0👍
To use useFind
you need to use vue composable api instead of normal functions/options.
Here’s how it should looks like instead:
export default {
component: 'PageName',
setup(_ , { root }) {
const { Book } = root.$FeathersVuex.api;
const pathBody = root.$route.path.split("/")[1];
const bookParams = computed(() => {
return {
query: {
referral_link: pathBody
}
};
});
const { items: books } = await useFind({
model: Book,
params: bookParams
});
return {
books
}
}
}
Also the data on won’t be there on mounted
since it took time to actually fetch. You can add isPending
besides the returned items
. Then use it on your template with v-if
.
- [Vuejs]-Vuex- Page is not updating after commit changes made to state
- [Vuejs]-Image should take remaining place (Vue/Tailwind/Flex)
Source:stackexchange.com