mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-16 11:54:27 +00:00
feat: prototype.setPackageName增加第二个入参
This commit is contained in:
parent
31bae2b94c
commit
8f2ffed451
@ -19,6 +19,7 @@ function getCamelName(name: string) {
|
|||||||
export interface ComponentProtoBundle {
|
export interface ComponentProtoBundle {
|
||||||
// @ali/vc-xxx
|
// @ali/vc-xxx
|
||||||
name: string;
|
name: string;
|
||||||
|
version?: string;
|
||||||
componentName?: string;
|
componentName?: string;
|
||||||
category?: string;
|
category?: string;
|
||||||
module: Prototype | Prototype[];
|
module: Prototype | Prototype[];
|
||||||
@ -217,7 +218,7 @@ export default class Bundle {
|
|||||||
proto.setView(this.viewsMap[componentName]);
|
proto.setView(this.viewsMap[componentName]);
|
||||||
}
|
}
|
||||||
if (cp.name && !proto.getPackageName()) {
|
if (cp.name && !proto.getPackageName()) {
|
||||||
proto.setPackageName(cp.name);
|
proto.setPackageName(cp.name, cp.version);
|
||||||
}
|
}
|
||||||
this.registerPrototype(proto);
|
this.registerPrototype(proto);
|
||||||
}
|
}
|
||||||
@ -229,7 +230,7 @@ export default class Bundle {
|
|||||||
prototype.setCategory(item.category);
|
prototype.setCategory(item.category);
|
||||||
}
|
}
|
||||||
if (item.name && !prototype.getPackageName()) {
|
if (item.name && !prototype.getPackageName()) {
|
||||||
prototype.setPackageName(item.name);
|
prototype.setPackageName(item.name, item.version);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -368,12 +368,10 @@ class Prototype {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
setPackageName(name: string) {
|
setPackageName(name: string, version?: string) {
|
||||||
// 从资产包中获取包的更多信息
|
|
||||||
const packageInfo = designer?.editor?.get('assets')?.packages?.find((item: any) => item.package === name);
|
|
||||||
this.meta.setNpm({
|
this.meta.setNpm({
|
||||||
package: name,
|
package: name,
|
||||||
version: packageInfo?.version,
|
version,
|
||||||
componentName: this.getComponentName(),
|
componentName: this.getComponentName(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user