Closed sunmingtao closed 3 years ago
Vue.use(...)
is Vue js 2 syntax. The new syntax is:
import { createApp } from 'vue'
import App from './App.vue'
const VueResource = require('vue-resource');
createApp(App).use(VueResource).mount('#app')
But this.$http.get("http://...")...
doesn't work. It complains "this.$http is undefined".
It looks like vue-resource is not compatible with Vue 3.
Another issue https://github.com/sunmingtao/sample-code/issues/251 covers this. Hence closed
Import VueResource as below in Vue js 3
Browser console