Skip to content

Commit ff89cf9

Browse files
committed
feat: add user custom name.
1 parent bf1f402 commit ff89cf9

File tree

5 files changed

+2195
-18
lines changed

5 files changed

+2195
-18
lines changed

dist/vue-lodash.es5.js

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,39 @@
33
Object.defineProperty(exports, "__esModule", {
44
value: true
55
});
6-
/* eslint-disable */
6+
7+
var _lodash = require('lodash');
8+
9+
var _lodash2 = _interopRequireDefault(_lodash);
10+
11+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12+
13+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /* eslint-disable */
14+
15+
16+
var genericInstall = function genericInstall(Vue) {
17+
Vue._ = _lodash2.default;
18+
Object.defineProperties(Vue.prototype, {
19+
_: {
20+
get: function get() {
21+
return _lodash2.default;
22+
}
23+
}
24+
});
25+
};
26+
727
var VueLodash = {
8-
install: function install(Vue, _) {
9-
Vue._ = _;
10-
Object.defineProperties(Vue.prototype, {
11-
_: {
28+
install: function install(Vue, options) {
29+
if (options && options.name) {
30+
Vue[options.name] = _lodash2.default;
31+
Object.defineProperties(Vue.prototype, _defineProperty({}, options.name, {
1232
get: function get() {
13-
return _;
33+
return _lodash2.default;
1434
}
15-
}
16-
});
35+
}));
36+
} else {
37+
genericInstall(Vue);
38+
}
1739
Vue.mixin({
1840
mounted: function mounted() {
1941
// Just tell you that it is mounted

dist/vue-lodash.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.

0 commit comments

Comments
 (0)