add attrMix.js

This commit is contained in:
zhw2590582 committed 2022-01-07 18:35:05 +08:00
1 parent 1438ce5e82
commit 938e8718bc
12 files changed
+268 -232

No files matched your search

-1
View File
@@ -34,7 +34,6 @@ export default class Plugins {
add(plugin) {
this.id += 1;
errorHandle(typeof plugin === 'function', `The Plugins.add() first parameter is not a function`);
const result = plugin.call(this, this.art);
const pluginName = (result && result.name) || plugin.name || `plugin${this.id}`;
errorHandle(!has(this, pluginName), `Cannot add a plugin that already has the same name: ${pluginName}`);