Skip to content

fix: 修复子编辑器修改丢失问题 #11867

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 22 additions & 21 deletions packages/amis-editor-core/src/store/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -929,27 +929,7 @@ export const MainStore = types

get subEditorValue() {
if (self.subEditorContext) {
let subSchema = self.subEditorContext.slot
? {
...mapObject(self.subEditorContext.slot, function (value: any) {
if (value === '$$') {
return self.subEditorContext!.value;
}

return value;
}),
isSlot: true
}
: self.subEditorContext.value;

if (!subSchema.definitions) {
subSchema = {
...subSchema,
definitions: modalsToDefinitions(this.modals)
};
}

return subSchema;
return self.subEditorContext.value;
}

return undefined;
Expand Down Expand Up @@ -2029,8 +2009,29 @@ export const MainStore = types
return;
}

let subSchema = context.slot
? {
...mapObject(context.slot, function (value: any) {
if (value === '$$') {
return context.value;
}

return value;
}),
isSlot: true
}
: context.value;

if (!subSchema.definitions) {
subSchema = {
...subSchema,
definitions: modalsToDefinitions(self.modals)
};
}

self.subEditorContext = {
...context,
value: subSchema,
hostNode: self.getNodeById(activeId),
data: createObject(
self.ctx,
Expand Down
Loading