fix(editor): 复制页面,页面名称重新生成

This commit is contained in:
roymondchen 2022-05-30 20:55:59 +08:00 committed by jia000
parent 5bfb69b36d
commit c80dab835d
2 changed files with 6 additions and 1 deletions

View File

@ -91,7 +91,7 @@ const doAction = async (
* editorService.afterAdd(); * editorService.afterAdd();
* } * }
* *
* before方法的参数中, before的return after的参数after最后一个参数则是原方法的return值; * before方法的参数中, before的return after的参数after一个参数则是原方法的return值;
* return new Error(); * return new Error();
* *
* 2 * 2

View File

@ -33,6 +33,7 @@ import {
change2Fixed, change2Fixed,
COPY_STORAGE_KEY, COPY_STORAGE_KEY,
Fixed2Other, Fixed2Other,
generatePageNameByApp,
getNodeIndex, getNodeIndex,
initPosition, initPosition,
isFixed, isFixed,
@ -502,6 +503,10 @@ class Editor extends BaseService {
}; };
} }
if (isPage(config)) {
config.name = generatePageNameByApp(this.get('root'));
}
return await this.add(config); return await this.add(config);
} }