vuejs2+axios設置


http://www.cnblogs.com/wisewrong/p/6402183.html

1 當前項目安裝axios

$ cnpm i axios --save-dev

2 import axios from 'axios';

axios.get('api/seller')
        .then((res) => {
        if (res.status === 200) {
          res = res.data;
          if (res.errno === ERR_OK) {
            this.seller = Object.assign({}, this.seller, res.data);
          }
        };
      })
      .catch(function(err) {
          console.log(err); // 從數據庫獲取數據出現問題
});

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM