Open noecs opened 4 years ago
Supplementary explanation:
main.js
import Vue from 'vue'
import App from './App.vue'
import VueResource from 'vue-resource';
Vue.use(VueResource);
Vue.config.productionTip = false;
new Vue({
http: {
root: 'http://google.com'
},
render: h => h(App),
}).$mount('#app');
App.vue
<template>
<div id="app">
F12 for test
<button v-on:click="onLoad">click me</button>
</div>
</template>
<script>
export default {
name: 'App',
methods: {
onLoad: function () {
this.$http.get('test');
}
}
}
</script>
Setting
Vue.http.options.root = 'http://google.com';
does not seem to work either
I checked most of the issues. This is always a problem. This package does not seem to be maintained and updated. I will use other packages as an alternative. @IanT8
Do you intend to use axios instead? I hit this problem doing Max Schwarzmueller's Vue.js course on Udemy.
On Mon, 13 Apr 2020 at 20:19, noecs notifications@github.com wrote:
I checked most of the issues. This is always a problem. This package does not seem to be maintained and updated. I will use other packages as an alternative. @IanT8 https://github.com/IanT8
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pagekit/vue-resource/issues/741#issuecomment-612842185, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMYL73QZ424L25Z2MJOKD3RMLRLDANCNFSM4MGYNL4Q .
Yes, I think I will encapsulate an axios that I use. Although it is not elegant and independent of vue, it should be very effective.
@IanT8 I didn't understand the links you provided. Unable to open the link.
I use the following code, root does not take effect.