Skip to content

Commit

Permalink
feat: schema-builder 新增 methods 方法
Browse files Browse the repository at this point in the history
  • Loading branch information
lhbxs committed Nov 13, 2023
1 parent d31db5d commit 671d780
Showing 1 changed file with 2 additions and 38 deletions.
40 changes: 2 additions & 38 deletions docs/schema-builder/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,49 +56,13 @@ externals: {
* background: 'rgb(204,204,204, .33)'
* padding: 20px
*/
import React, { useRef, useEffect } from 'react';
import React from 'react';
import SchemaBuilder from '@xrenders/schema-builder';

const schema = {
"type": "object",
"properties": {
"fr-bfuw": {
"title": "单行文本",
"type": "string",
"widget": "input"
},
"fr-5n84": {
"title": "单行文本",
"type": "string",
"widget": "input"
}
},
"displayType": "row",
"maxWidth": "340px"
};


const Demo = () => {

const domRef = useRef ();



return (
<div style={{ height: '80vh' }}>
<SchemaBuilder
importBtn={true}
exportBtn={true}
pubBtn={false}
ref = {domRef}
onMount={() => {
const value = domRef.current.getValue();

domRef.current.setValue(schema);

domRef.current.copyValue(schema);
}}
/>
<SchemaBuilder importBtn={true} exportBtn={true} pubBtn={false} />
</div>
);
};
Expand Down

0 comments on commit 671d780

Please sign in to comment.