mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-02-28 12:50:38 +00:00
fix: 修复 registerAddon 函数
This commit is contained in:
parent
76c4a542bf
commit
309920a07a
@ -17,6 +17,7 @@ module.exports = {
|
||||
collectCoverageFrom: [
|
||||
'src/**/*.{ts,tsx}',
|
||||
'!src/**/*.d.ts',
|
||||
'!src/icons',
|
||||
'!**/node_modules/**',
|
||||
'!**/vendor/**',
|
||||
],
|
||||
|
||||
@ -584,14 +584,10 @@ export class DocumentModel {
|
||||
if (['id', 'params', 'layout'].indexOf(name) > -1) {
|
||||
throw new Error('addon name cannot be id, params, layout');
|
||||
}
|
||||
const i = this._addons?.findIndex((item) => item.name === name);
|
||||
if (i > -1) {
|
||||
this._addons?.splice(i, 1);
|
||||
if (this._addons[name]) {
|
||||
throw new Error(`node addon ${name} exists`);
|
||||
}
|
||||
this._addons?.push({
|
||||
exportData,
|
||||
name,
|
||||
});
|
||||
this._addons[name] = exportData;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user