Vueのインタフェース呼び出しはvue-resourcesですか、axiosですか.


vue-resources公式はもうお勧めしませんが、axiosを使いましょう.
インストール
npm install axios --save

使用方法(RESTful)
GETリクエスト
Axios.get('article', {
  params: {id: 10010}
}).then(res => {
  console.log(res)
}).catch(err => {
  console.log(err)
})

POSTリクエスト
Axios.post('article', {
  title: 'Axios is very N13',
  content: 'Yes, I can not agree with you more.'
}).then(res => {
  console.log(res)
}).catch(err => {
  console.log(err)
})

PUT要求
Axios.put('article', {
  id: 10010,
  title: 'Axios is very N13',
  content: 'Yes, I can not agree with you more.'
}).then(res => {
  console.log(res)
}).catch(err => {
  console.log(err)
})

「同期」するのは簡単ですaxiosはPromise実装です.これは、awaitキーワードを使用して同期呼び出しを実装できることを意味します.