November 2017
Beginner to intermediate
398 pages
8h 42m
English
We have a problem--each component using our RemoteData mixin will have different data properties to fetch. Therefore, we need to pass parameters to our mixin. Since a mixin is essentially a definition object, why not use a function that can take parameters and then return a definition object? That's what we will do in our case!
export default function (resources) { return { data () { return { remoteDataLoading: 0, } }, } }
The resources parameter will be an object with each key being the name of the data property we want to add, and the value being the path of the request that needs to be made to the server.
Read now
Unlock full access