Skip to content

Commit 37fce20

Browse files
committed
doc: Update document.
1 parent 0f7a959 commit 37fce20

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
React Component Example
1+
React Code Preview
22
---
33

4+
Code editor for React. Preview Demo: https://uiwjs.github.io/react-code-preview
5+
6+
There are often a lot of sample code in the documentation. We hope that you can run the sample code to view the rendering interface as you read the document.
7+
48
## Install
59

610
```bash
@@ -14,19 +18,30 @@ import React from 'react';
1418
import { Button } from 'uiw';
1519
import CodePreview from '@uiw/react-code-preview';
1620

21+
const code = `import { Button, Divider, Icon } from 'uiw';
22+
ReactDOM.render(
23+
<div>
24+
<Button type="primary">主要按钮</Button>
25+
</div>,
26+
_mount_
27+
);
28+
`;
29+
1730
class Demo extends React.Component {
1831
render() {
1932
return (
2033
<CodePreview
21-
code="const a = 0;"
34+
code={code}
2235
dependencies={{ Button }}
2336
/>
2437
);
2538
}
2639
}
2740
```
2841

29-
### Properties
42+
- `_mount_` Special strings, the compilation will be replaced.
43+
44+
### Props
3045

3146
```jsx
3247
/**

0 commit comments

Comments
 (0)