GeezerVison is showing github.com — fix: fix slot id is automatically generated every time · Dicky-L/lowcode-engine@33a4192
File tree
Expand file treeCollapse file tree
Open diff view settings
tests/document/node/props
react-simulator-renderer/src
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: packages/designer/src/document/node/props/prop.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -401,7 +401,7 @@ export class Prop implements IProp, IPropParent { |
401 | 401 | slotSchema = { |
402 | 402 | componentName: 'Slot', |
403 | 403 | title: value.title || value.props?.slotTitle, |
404 | | - id: data.id, |
| 404 | + id: value.id, |
405 | 405 | name: value.name || value.props?.slotName, |
406 | 406 | params: value.params || value.props?.slotParams, |
407 | 407 | children: value.children, |
|
Collapse file
Copy file name to clipboardExpand all lines: packages/designer/tests/document/node/props/prop.test.ts +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -518,6 +518,7 @@ describe('Prop 类测试', () => { |
518 | 518 | type: 'JSSlot', |
519 | 519 | value: { |
520 | 520 | componentName: 'Slot', |
| 521 | + id: 'node_oclei5rv2e2', |
521 | 522 | props: { |
522 | 523 | slotName: "content", |
523 | 524 | slotTitle: "主内容" |
@@ -534,6 +535,7 @@ describe('Prop 类测试', () => { |
534 | 535 |
|
535 | 536 | expect(slotProp.slotNode?.title).toBe('主内容'); |
536 | 537 | expect(slotProp.slotNode?.getExtraProp('name')?.getValue()).toBe('content'); |
| 538 | + expect(slotProp.slotNode?.export()?.id).toBe('node_oclei5rv2e2'); |
537 | 539 |
|
538 | 540 | slotProp.export(); |
539 | 541 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: packages/react-simulator-renderer/src/renderer-view.tsx +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -170,7 +170,9 @@ class Renderer extends Component<{ |
170 | 170 | this.startTime = Date.now(); |
171 | 171 | this.schemaChangedSymbol = false; |
172 | 172 |
|
173 | | - if (!container.autoRender || isRendererDetached()) return null; |
| 173 | + if (!container.autoRender || isRendererDetached()) { |
| 174 | + return null; |
| 175 | + } |
174 | 176 |
|
175 | 177 | const { intl } = createIntl(locale); |
176 | 178 |
|
|