vue-json-excel
vue-json-excel copied to clipboard
[Vue warn]: Invalid prop: type check failed for prop "fetch". Expected Function, got Promise
<template>
<div id="app">
<h2>Fetch Example</h2>
<downloadexcel
class = "btn"
:fetch = "fetchData(arguments)"
:fields = "json_fields"
:before-generate = "startDownload"
:before-finish = "finishDownload"
type = "csv">
Download Excel
</downloadexcel>
</div>
</template>
i need to add aguments in fetchData method,but if i do this,error happens.
[Vue warn]: Invalid prop: type check failed for prop "fetch". Expected Function, got Promise
Have you solved the issue? I have a similar issue. In callback I dispatch vuex action. It means I have a promise in my function. It seems that fetch function is executed continuously and return same error you get.
@albertovincenzi I think the problem is that the fetch prop is type function... It will be excuted asynchronously, but the type check fails and never get call. I'm updating this component this week, I let you know if I come across any solution.
I had the same error, but it is working now. If you have to pass argument to fetch callback, call like this
:fetch= "()=>{return getInvoices(props.item.user.id)}"
@Mani1124 oh I see! that's a really good solution... I'm going to test this over the weekend, if everything goes well I'll update the documentation... Thanks!