<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                有很多時候在構建應用時需要訪問一個api并展示其數據,做這個事情的方法有好幾種axios fetch resource 而使用基于promise的HTTP客戶端axios則是其中非常流行的一中。 axios是一個基于Promise用于瀏覽器和nodejs的HTTP客戶端,本身具有以下特征: 從瀏覽器中創建XMLHttpRequest 從node.js發出http請求 支持Promise API 攔截請求和響應 轉換請求和響應數據 取消請求 自動轉換JSON數據 客戶端支持防止CSRF/XSRF 下載地址: https://github.com/axios/axios ## 可以用CDN引包 ``` <script src="https://unpkg.com/axios/dist/axios.min.js"></script> ``` ``` getDate:function (){ axios.get('http://127.0.0.1/index.php').then(function (res){ console.log(res.data) }) ``` ## then()方法是異步執行 意思是:就是當.then()前的方法執行完后再執行then()內部的程序,這樣就避免了,數據沒獲取到等的問題。 ``` getDate:function (){ axios.get('http://127.0.0.1/index.php').then(res=>{ console.log(this) }) ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看