html页面引用axios使用,在普通html页面中使用axios问题
2022/3/6 6:16:38
本文主要是介绍html页面引用axios使用,在普通html页面中使用axios问题,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
<!-- 引入axios -->
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
getDataOrder: function (ordernos, appid) {
let _this = this;
// let Url = 'http://xxx.xxx.xxx/xxx/xxx/xxx/xxx?appid=aGFsZXN1bg&ordernos=HS190305081,HS190305080';
axios({
headers: {
'Content-Type': 'application/json;charset=UTF-8'
},
method: 'get',
url: Url,
params: {
appid: appid,
ordernos: ordernos,
}
}).then(function (response) {
if (response.data.code === 0) {
_this.datalist = response.data.data;
_this.message = response.data.message;
}
}).catch(function (error) {
console.log(error)
_this.$message({
type: 'error',
message: error.message
})
})
},
这篇关于html页面引用axios使用,在普通html页面中使用axios问题的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-05-30毕设私活神器
- 2024-05-30html
- 2024-05-09一定要避坑:关于微信H5分享,温馨提示你不要再踩坑了!!!
- 2024-05-09本地项目放到公网访问!炒鸡煎蛋!
- 2024-04-07金融企业区域集中库的设计构想和测试验证
- 2024-03-11前端CSS的工程化——掌握Sass这四大特性就够了
- 2024-02-21h5关联css样式(html怎么和css关联)-icode9专业技术文章分享
- 2024-02-07Firefox禁止远程字体加速网页加载及图标字体补充安装
- 2024-02-07一个菜鸡前端的3年总结-「2023」
- 2024-01-18最火前端Web组态软件(可视化)