Procházet zdrojové kódy

improve the use function

tags/2.16.0
Caven Chen před 3 roky
rodič
revize
5fdcc4b563
1 změnil soubory, kde provedl 4 přidání a 1 odebrání
  1. 4
    1
      modules/global-api/use.js

+ 4
- 1
modules/global-api/use.js Zobrazit soubor

@@ -9,7 +9,7 @@
* @returns this
*/
export function initUse(DC) {
DC.use = function(plugin) {
DC.use = function(plugin, lib) {
const installedPlugins =
this._installedPlugins || (this._installedPlugins = {})
if (this._installedPlugins[plugin.name]) {
@@ -17,6 +17,9 @@ export function initUse(DC) {
}
// additional parameters
const args = []
if (lib) {
args.push(lib)
}
args.unshift(this)
if (typeof plugin.install === 'function') {
plugin.install.apply(plugin, args)

Načítá se…
Zrušit
Uložit