亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

javascript - 運用vue-cli做項目,如何向後臺請求真實的資料呢?
世界只因有你
世界只因有你 2017-05-19 10:36:41
0
5
832

運用vue-cli做項目,如何向後臺請求真實的資料呢?

世界只因有你
世界只因有你

全部回覆(5)
小葫蘆

後臺沒給你開介面嘛?

PHPzhong

可以使用vue-resource

//get || post
this.$http.get(url).then((res) => {
    // do something
}, (res) => {
    // error callback
})
phpcn_u1582

可以使用vue-resource進行請求
樓主可能遇到的是跨域問題?
如果後臺是php的話請在接收的方法中加入

header('Access-Control-Allow-Credentials:true');
header("Access-Control-Allow-Origin:*");
header('Access-Control-Allow-Headers:x-requested-with,content-type');
Peter_Zhu

axios,jquery

大家講道理

樓主的意思是怎麼請求後端數(shù)據(jù),並不是說沒有接口,。配置個代理程式就好了,不用跨域,在config下的index.js裡有個proxyTable設定下就好了。

最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板