mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
fix: 修复弹框复制id重复问题 (#10954)
* fix: 修复弹框复制id重复问题 * 深拷贝下 --------- Co-authored-by: qinhaoyan <30946345+qinhaoyan@users.noreply.github.com>
This commit is contained in:
parent
9180df9dcd
commit
0ce7e04ffc
@ -2,9 +2,15 @@ import {ClassNamesFn} from 'amis-core';
|
||||
import {observer} from 'mobx-react';
|
||||
import React from 'react';
|
||||
import {EditorStoreType} from '../../store/editor';
|
||||
import {JSONGetById, modalsToDefinitions, translateSchema} from '../../util';
|
||||
import {
|
||||
JSONGetById,
|
||||
modalsToDefinitions,
|
||||
reGenerateID,
|
||||
translateSchema
|
||||
} from '../../util';
|
||||
import {Button, Icon, ListMenu, PopOverContainer, confirm} from 'amis';
|
||||
import {EditorManager} from '../../manager';
|
||||
import cloneDeep from 'lodash/cloneDeep';
|
||||
|
||||
export interface DialogListProps {
|
||||
classnames: ClassNamesFn;
|
||||
@ -94,7 +100,9 @@ export default observer(function DialogList({
|
||||
event.currentTarget.closest('[data-index]')!.getAttribute('data-index')!,
|
||||
10
|
||||
);
|
||||
const dialog = store.modals[index];
|
||||
let dialog = cloneDeep(store.modals[index]);
|
||||
dialog = reGenerateID(dialog);
|
||||
|
||||
store.addModal({
|
||||
...dialog,
|
||||
title: `${dialog.title} - 复制`,
|
||||
|
Loading…
Reference in New Issue
Block a user