Commit 27ed2d84 authored by jaden's avatar jaden

fix: fix text

parent 5c916b48
...@@ -42,6 +42,17 @@ function Error() { ...@@ -42,6 +42,17 @@ function Error() {
return <code>{error}</code>; return <code>{error}</code>;
} }
const init = `/**
* @description 处理数据的函数
* @param record<string,any> data
*/
function handler(data){
return data
}
`;
export function ChatView({ export function ChatView({
defaultNode, defaultNode,
props: propsRaw, props: propsRaw,
...@@ -206,7 +217,7 @@ export function ChatView({ ...@@ -206,7 +217,7 @@ export function ChatView({
onClick={async () => { onClick={async () => {
const data = await workerFn( const data = await workerFn(
propsRaw, propsRaw,
`${editor.getValue()};\n return handler(data);` `${editor?.getValue()};\n return handler(data);`
); );
console.log(data); console.log(data);
setProps(data); setProps(data);
...@@ -225,16 +236,7 @@ export function ChatView({ ...@@ -225,16 +236,7 @@ export function ChatView({
}} }}
height="300px" height="300px"
defaultLanguage="javascript" defaultLanguage="javascript"
defaultValue={`/** defaultValue={init}
* @description 处理数据的函数
* @param record<string,any> data
*/
function handler(data){
return data
}
`}
/> />
</CollapseItem> </CollapseItem>
</Collapse> </Collapse>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment