Skip to content

Commit

Permalink
feat: id 默认转testid && editor部分组件配置面板补充testid
Browse files Browse the repository at this point in the history
  • Loading branch information
allenve committed Jan 22, 2024
1 parent dd45281 commit a1f5c91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/amis-core/src/SchemaRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ export class SchemaRenderer extends React.Component<SchemaRendererProps, any> {
(props as any).static = isStatic;
}

if (props.id && !props.testid) {
if (rest.env.enableTestid && props.id && !props.testid) {
props.testid = props.id;
}

Expand Down
5 changes: 5 additions & 0 deletions packages/amis-core/src/env.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ export interface RendererEnv {
*/
enableAMISDebug?: boolean;

/**
* 是否开启 testid 定位
*/
enableTestid?: boolean;

/**
* 替换文本,用于实现 URL 替换、语言替换等
*/
Expand Down

0 comments on commit a1f5c91

Please sign in to comment.