fix(editor,react-runtime-help,vue-runtime-help): 修复拖动页面顺序失效问题

This commit is contained in:
roymondchen 2025-06-20 20:10:24 +08:00
parent 32681964b3
commit b6a260471d
5 changed files with 15 additions and 3 deletions

View File

@ -136,7 +136,7 @@ watch(
let beforeDragList: Id[] = []; let beforeDragList: Id[] = [];
const options = { const options = {
...{ ...{
dataIdAttr: 'page-id', // dataIdAttr: 'data-page-id', //
onStart: async (event: SortableEvent) => { onStart: async (event: SortableEvent) => {
if (typeof props.pageBarSortOptions?.beforeStart === 'function') { if (typeof props.pageBarSortOptions?.beforeStart === 'function') {
await props.pageBarSortOptions.beforeStart(event, sortable); await props.pageBarSortOptions.beforeStart(event, sortable);

View File

@ -1,5 +1,5 @@
{ {
"version": "0.1.0", "version": "0.1.1",
"name": "@tmagic/react-runtime-help", "name": "@tmagic/react-runtime-help",
"type": "module", "type": "module",
"sideEffects": false, "sideEffects": false,

View File

@ -50,7 +50,13 @@ export const useEditorDsl = (app: TMagicApp, renderDom: () => void) => {
}, },
update({ config, root, parentId }: UpdateData) { update({ config, root, parentId }: UpdateData) {
if (config.type === 'app') {
this.updateRootConfig?.(config as MApp);
return;
}
const newNode = app?.dataSourceManager?.compiledNode(config, undefined, true) || config; const newNode = app?.dataSourceManager?.compiledNode(config, undefined, true) || config;
replaceChildNode(newNode, [root], parentId); replaceChildNode(newNode, [root], parentId);
updateConfig(cloneDeep(root)); updateConfig(cloneDeep(root));
}, },

View File

@ -1,5 +1,5 @@
{ {
"version": "1.1.4", "version": "1.1.5",
"name": "@tmagic/vue-runtime-help", "name": "@tmagic/vue-runtime-help",
"type": "module", "type": "module",
"sideEffects": false, "sideEffects": false,

View File

@ -90,7 +90,13 @@ export const useEditorDsl = (app = inject<TMagicApp>('app'), win = window) => {
update({ config, parentId }: UpdateData) { update({ config, parentId }: UpdateData) {
if (!root.value || !app) throw new Error('error'); if (!root.value || !app) throw new Error('error');
if (config.type === 'app') {
this.updateRootConfig?.(config as MApp);
return;
}
const newNode = app.dataSourceManager?.compiledNode(config, undefined, true) || config; const newNode = app.dataSourceManager?.compiledNode(config, undefined, true) || config;
replaceChildNode(reactive(newNode), [root.value], parentId); replaceChildNode(reactive(newNode), [root.value], parentId);
const nodeInstance = app.getNode(config.id); const nodeInstance = app.getNode(config.id);