mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-19 03:55:50 +08:00
fix(editor,react-runtime-help,vue-runtime-help): 修复拖动页面顺序失效问题
This commit is contained in:
parent
32681964b3
commit
b6a260471d
@ -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);
|
||||||
|
@ -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,
|
||||||
|
@ -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));
|
||||||
},
|
},
|
||||||
|
@ -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,
|
||||||
|
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user