工作总结3:axios里面的主要参数
生活随笔
收集整理的這篇文章主要介紹了
工作总结3:axios里面的主要参数
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
<template><div class="axios"></div>
</template>
?
<script> import axios from 'axios'export default {name: 'axios3-2',created() {// 實際開發// 兩種請求接口:// http://localhost:9090// http://localhost:9091const instance = axios.create({ // 創建instance實例baseURL: 'http://localhost:9090',timeout: 1000})const instance1 = axios.create({ // 創建instance1實例baseURL: 'http://localhost:9091',timeout: 3000})instance.get('/contactList', { //請求數據 (用到的配置參數:baseURL,timeout,url,method,params)params: {}}).then(res => {console.log(res)})instance1.get('/orderList', { //請求數據 (用到的配置參數:baseURL,timeout:5000,url,method)timeout: 5000 // timeout重新賦值}).then(res => {console.log(res)})}, } </script>?
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的工作总结3:axios里面的主要参数的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 人事管理信息系统
- 下一篇: 企业如何选择SSL证书?