Skip to content

Commit ecfcb24

Browse files
committed
feat: New ver
1 parent 217e7fd commit ecfcb24

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

dist/vue-axios.es5.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ Object.defineProperty(exports, "__esModule", {
66

77
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
88

9-
var _axios = require('axios');
10-
11-
var _axios2 = _interopRequireDefault(_axios);
12-
13-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14-
159
/**
1610
* Copied from vue-resource
1711
*/
@@ -76,13 +70,18 @@ function options(fn, obj, opts) {
7670
* @param Vue
7771
*/
7872

79-
function plugin(Vue) {
73+
function plugin(Vue, axios) {
8074

8175
if (plugin.installed) {
8276
return;
8377
}
8478

85-
Vue.axios = _axios2.default;
79+
if (!axios) {
80+
console.error('You have to install axios');
81+
return;
82+
}
83+
84+
Vue.axios = axios;
8685

8786
Object.defineProperties(Vue.prototype, {
8887

dist/vue-axios.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-axios",
3-
"version": "1.0.2",
3+
"version": "1.1.0",
44
"description": "A small wrapper for integrating axios to Vuejs",
55
"main": "dist/vue-axios.min.js",
66
"scripts": {
@@ -31,6 +31,5 @@
3131
"gulp-uglifyjs": "^0.6.2"
3232
},
3333
"dependencies": {
34-
"axios": "^0.15.2"
3534
}
3635
}

src/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import axios from 'axios';
2-
31
/**
42
* Copied from vue-resource
53
*/
@@ -63,12 +61,17 @@ function options(fn, obj, opts) {
6361
* @param Vue
6462
*/
6563

66-
function plugin(Vue) {
64+
function plugin(Vue, axios) {
6765

6866
if (plugin.installed) {
6967
return;
7068
}
7169

70+
if (!axios) {
71+
console.error('You have to install axios')
72+
return
73+
}
74+
7275
Vue.axios = axios
7376

7477
Object.defineProperties(Vue.prototype, {

0 commit comments

Comments
 (0)