mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-19 14:04:28 +00:00
fix copy & paste
This commit is contained in:
parent
be4a58fc14
commit
9c8f492d03
@ -6,7 +6,17 @@ function getDataFromPasteEvent(event: ClipboardEvent) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// { componentsMap, componentsTree, ... }
|
// { componentsMap, componentsTree, ... }
|
||||||
return JSON.parse(clipboardData.getData('text/plain'));
|
const data = JSON.parse(clipboardData.getData('text/plain'));
|
||||||
|
if (!data) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
if (data.componentsTree) {
|
||||||
|
return data;
|
||||||
|
} else if (data.componentName) {
|
||||||
|
return {
|
||||||
|
componentsTree: [ data ]
|
||||||
|
};
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
/*
|
/*
|
||||||
const html = clipboardData.getData('text/html');
|
const html = clipboardData.getData('text/html');
|
||||||
@ -19,7 +29,7 @@ function getDataFromPasteEvent(event: ClipboardEvent) {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
// TODO: open the parser implement
|
// TODO: open the parser implement
|
||||||
return null;
|
return { };
|
||||||
/*
|
/*
|
||||||
return {
|
return {
|
||||||
code: clipboardData.getData('text/plain'),
|
code: clipboardData.getData('text/plain'),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user