-
如题,请问如何做到 修改现有schema 呢? //此处获取为空
const apiAdaptor = getSchemaTpl('apiRequestAdaptor');
let requestApiSchema = findTree(apiAdaptor, (node) => {
node.type == 'code' && node.language == 'typescript';
});
debugger;
if (requestApiSchema) {
requestApiSchema.value = `
{
url: string; // 当前接口地址111111111111111
method: 'get' | 'post' | 'put' | 'delete';
data?: Object; // 请求体
headers?: Object; // 请求头
...
}`;
}
setSchemaTpl('apiAdaptor', apiAdaptor); |
Beta Was this translation helpful? Give feedback.
Answered by
hyzx86
Apr 20, 2023
Replies: 2 comments
-
调整代码。。虽然能拿到。但还是没用~ const apiConfigSchema = getSchemaTpl('api');
let requestApiSchema = set(apiConfigSchema, 'body[2].items[14].body[0].label', '测试赋值');
setSchemaTpl('api', requestApiSchema); |
Beta Was this translation helpful? Give feedback.
0 replies
-
已解决 😘 addSchemaFilter((schema: Schema, renderer: RendererConfig, props?: any) => {
console.log('addSchemaFilter props: ', props);
console.log('addSchemaFilter renderer: ', renderer);
console.log('addSchemaFilter schema: ', schema);
if (renderer.type == 'js-editor') {
schema.label = schema.label + '11111';
debugger;
}
return schema;
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
hyzx86
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
已解决 😘