ratiw / vuetable-2-tutorial

MIT License
258 stars 67 forks source link

Error when using axios for Vue.$http #34

Closed semir-karic closed 7 years ago

semir-karic commented 7 years ago

Since vue-resource is deprecated if you use axios for HTTP requests like Vue.prototype.$http = axios

you get an error Uncaught TypeError: Cannot set property $http of #<Vue$3> which has only a getter

Maybe it would be better if it was up to user to chose the Vue $http handler since with the current way there is no possibility of using axios as $http handler replacement

ratiw commented 7 years ago

@semir-karic This has been discussed in various places in the issues of main Vuetable-2 repo. Someone has already submitted a PR to replace axios with vue-resource and it has already been incorporated into develop branch.

semir-karic commented 7 years ago

Found the patch. Thanks and great library by the way.

vidyarthitech2tech commented 6 years ago

Hey @semir-karic , How did you fix this? I am getting the same error.

semir-karic commented 6 years ago

@vidyarthitech2tech just pull the latest vuetable and check this link https://ratiw.github.io/vuetable-2/#/Vuetable-Properties?id=-http-fetch-v17 You can now use your own axios instance to fetch the data.