Closed asmaps closed 8 years ago
Usage:
Vue.use(VueTables.server, {
serverDataFieldName: 'results',
})
I also added another commit that makes the query parameters configurable.
TODO: Update the jsfiddle with the options documentation
Honestly, I am not a big fan of the idea of "bending" the API towards the consumer. In case the response from a remote API almost matches the plugin's requirements by accident, one is welcome to fork the repo and change whatever keys he needs. See PR #38.
As for the params
issue, vue-resource
had a breaking change in version 0.9.0, which, as the documentation states, is the minimum version required. I suppose you are using an older version, which explains why everything is wrapped with the params
property. See Issue #64.
+1 for making it in base flexbile
The reply of my API (Django REST Framework default) looks like this:
so I needed an option to change in which field the server table looks for the objects (in this case
results
instead ofdata
). In this PR I added that feature. I hope you find it useful.