We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f17ca9 commit 12580b3Copy full SHA for 12580b3
package.json
@@ -1,7 +1,7 @@
1
{
2
"name": "vue-x-axios",
3
"description": "基于axios扩展的Vue异步请求插件,为前端实现API统一管理的解决方案。",
4
- "version": "2.4.0",
+ "version": "2.5.0",
5
"author": "undefined100 <[email protected]>",
6
"license": "MIT",
7
"private": false,
src/lib/vue-x-axios.js
@@ -456,10 +456,15 @@ let api = {
456
$api.all = requestArray => {
457
return batchAjax(requestArray)
458
}
459
- // 添加全局方法
460
- Vue.$api = $api
461
- // 添加实例方法
462
- Vue.prototype.$api = $api
+
+ if (Vue.version.startsWith('3')) {
+ Vue.config.globalProperties = $api
+ } else {
463
+ // 添加全局方法
464
+ Vue.$api = $api
465
+ // 添加实例方法
466
+ Vue.prototype.$api = $api
467
+ }
468
469
470
export default api
0 commit comments