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