Closed liamwang closed 7 years ago
You can see some usage examples on the testable
branch.
There is only one request example from the vuex store but you can just use similar code within prefetch function if you want to fetch data into a component`s data. Something like that:
import http from 'src/http';
export default {
data: () => ({ whatever: null })
prefetch: () => http.get('whatever').then(res => ({
whatever: res.data
}))
}
Prefetching is just using Promise
s so you can do whatever you want and just resolve your promise object with any data you need.
@mrTimofey Thank you for replying.
Can you add some demos of server-side and client-side http requests.
It is greatly appreciated.