“Vue 网络应用 axios 基本使用”的版本间的差异
跳到导航
跳到搜索
Jihongchang(讨论 | 贡献) |
Jihongchang(讨论 | 贡献) |
||
第6行: | 第6行: | ||
<syntaxhighlight lang="html"> | <syntaxhighlight lang="html"> | ||
<script src="https://unpkg.com/axios/dist/axios.min.js"></script> | <script src="https://unpkg.com/axios/dist/axios.min.js"></script> | ||
− | axios.get(地址?key1=values&key2=value2).then(function(response){ | + | axios.get(地址?key1=values&key2=value2).then( |
− | }, function(err){ | + | function(response){ |
− | }) | + | }, |
+ | function(err){ | ||
+ | } | ||
+ | ); | ||
+ | |||
+ | axios.post(地址, | ||
+ | { | ||
+ | key1:value1, | ||
+ | key2:value2 | ||
+ | } | ||
+ | ).then( | ||
+ | function(response){ | ||
+ | }, | ||
+ | function(err){ | ||
+ | } | ||
+ | ); | ||
</syntaxhighlight> | </syntaxhighlight> |
2023年8月9日 (三) 05:42的版本
https://www.bilibili.com/video/BV12J411m7MG/?p=25
axios
功能强大的网络请求库
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
axios.get(地址?key1=values&key2=value2).then(
function(response){
},
function(err){
}
);
axios.post(地址,
{
key1:value1,
key2:value2
}
).then(
function(response){
},
function(err){
}
);