Closed
Description
I really like the new possibility to pass props to route components, thanks for implementing it!
As this would be a nice opportunity to use a props method as an API data fetcher, I'm intersted in passing a Promise either directly or returning one by this function.
I imagine something like this:
function asnycProps(route) {
return new Promise((resolve, reject) => {
ApiFramework.fetch(/* some route config */)
.then((data) => {
resolve(data);
});
});
}
const router = new VueRouter({
mode: 'history',
base: __dirname,
routes: [
{ path: '/dynamic', component: Hello, props: asyncProps }
]
})