deadsimple / axioslibrary
一个简单易用的模块,用于在您的Magento2项目中使用Axios组件
1.0.2
2020-09-30 13:04 UTC
Requires
- magento/framework: >=100.1.0
This package is auto-updated.
Last update: 2024-09-29 05:47:14 UTC
README
Deadsimple Axios Magento2 Composer Library
本包允许您直接在您的Magento2设置中包含最新的axios版本,并使用requirejs在全局范围内使用。
安装
使用composer安装模块: composer require deadsimple/axioslibrary
使用
使用此库非常简单,只需通过requirejs包含axios脚本,定义Axios并在您喜欢的任何地方使用它。
define([
'Axios'
], function (axios) {
'use strict';
// Make a request for a user with a given ID
axios.get('/user?ID=12345')
.then(function (response) {
// handle success
console.log(response);
})
.catch(function (error) {
// handle error
console.log(error);
})
.then(function () {
// always executed
});
})
版本
此库加载: Axios v0.19.2