mirror of
https://github.com/certd/certd.git
synced 2026-05-15 20:47:31 +08:00
feat: midway注解方式编写插件
This commit is contained in:
@@ -6,7 +6,7 @@ export type AccessInputDefine = FormItemProps & {
|
||||
required?: boolean;
|
||||
};
|
||||
export type AccessDefine = Registrable & {
|
||||
inputs?: {
|
||||
input?: {
|
||||
[key: string]: AccessInputDefine;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ export function IsAccess(define: AccessDefine): ClassDecorator {
|
||||
inputs[property] = input;
|
||||
}
|
||||
}
|
||||
_.merge(define, { inputs });
|
||||
_.merge(define, { input: inputs });
|
||||
Reflect.defineMetadata(ACCESS_CLASS_KEY, define, target);
|
||||
target.define = define;
|
||||
accessRegistry.register(define.name, {
|
||||
@@ -30,9 +30,9 @@ export function IsAccess(define: AccessDefine): ClassDecorator {
|
||||
};
|
||||
}
|
||||
|
||||
export function IsAccessInput(input?: AccessInputDefine): PropertyDecorator {
|
||||
export function AccessInput(input?: AccessInputDefine): PropertyDecorator {
|
||||
return (target, propertyKey) => {
|
||||
target = Decorator.target(target);
|
||||
target = Decorator.target(target, propertyKey);
|
||||
// const _type = Reflect.getMetadata("design:type", target, propertyKey);
|
||||
Reflect.defineMetadata(ACCESS_INPUT_KEY, input, target, propertyKey);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user