猿问

vue-resource的get请求参数怎么封装?

this.$http.get('https://crossorigin.me/https:...', {

  'key': 'xyr3ypdeuu9nslqy',

  'unit': 'c',

  'location': 'beijing',

  'language': 'zh-Hans'

}).then(function (response) {

  this.weather = response.data.results[0]

  console.log(response.data.results[0])

},

function (response) {

  console.log(response)

})


万千封印
浏览 1335回答 1
1回答
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答