Skip to content

Commit 3a45796

Browse files
committed
avoid use() a plugin more than once
1 parent 1fabb47 commit 3a45796

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/api/global.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ function createClass (name) {
8383
*/
8484

8585
exports.use = function (plugin) {
86+
if (plugin.installed) {
87+
return
88+
}
8689
// additional parameters
8790
var args = _.toArray(arguments, 1)
8891
args.unshift(this)
@@ -91,6 +94,7 @@ exports.use = function (plugin) {
9194
} else {
9295
plugin.apply(null, args)
9396
}
97+
plugin.installed = true
9498
return this
9599
}
96100

0 commit comments

Comments
 (0)