mirror of
				https://github.com/Tencent/tmagic-editor.git
				synced 2025-11-04 18:52:18 +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[] = [];
 | 
			
		||||
        const options = {
 | 
			
		||||
          ...{
 | 
			
		||||
            dataIdAttr: 'page-id', // 获取排序后的数据
 | 
			
		||||
            dataIdAttr: 'data-page-id', // 获取排序后的数据
 | 
			
		||||
            onStart: async (event: SortableEvent) => {
 | 
			
		||||
              if (typeof props.pageBarSortOptions?.beforeStart === 'function') {
 | 
			
		||||
                await props.pageBarSortOptions.beforeStart(event, sortable);
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
{
 | 
			
		||||
  "version": "0.1.0",
 | 
			
		||||
  "version": "0.1.1",
 | 
			
		||||
  "name": "@tmagic/react-runtime-help",
 | 
			
		||||
  "type": "module",
 | 
			
		||||
  "sideEffects": false,
 | 
			
		||||
 | 
			
		||||
@ -50,7 +50,13 @@ export const useEditorDsl = (app: TMagicApp, renderDom: () => void) => {
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    update({ config, root, parentId }: UpdateData) {
 | 
			
		||||
      if (config.type === 'app') {
 | 
			
		||||
        this.updateRootConfig?.(config as MApp);
 | 
			
		||||
        return;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      const newNode = app?.dataSourceManager?.compiledNode(config, undefined, true) || config;
 | 
			
		||||
 | 
			
		||||
      replaceChildNode(newNode, [root], parentId);
 | 
			
		||||
      updateConfig(cloneDeep(root));
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
{
 | 
			
		||||
  "version": "1.1.4",
 | 
			
		||||
  "version": "1.1.5",
 | 
			
		||||
  "name": "@tmagic/vue-runtime-help",
 | 
			
		||||
  "type": "module",
 | 
			
		||||
  "sideEffects": false,
 | 
			
		||||
 | 
			
		||||
@ -90,7 +90,13 @@ export const useEditorDsl = (app = inject<TMagicApp>('app'), win = window) => {
 | 
			
		||||
    update({ config, parentId }: UpdateData) {
 | 
			
		||||
      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;
 | 
			
		||||
 | 
			
		||||
      replaceChildNode(reactive(newNode), [root.value], parentId);
 | 
			
		||||
 | 
			
		||||
      const nodeInstance = app.getNode(config.id);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user