api-render-ui 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Readme.md CHANGED
@@ -15,27 +15,23 @@ api-render-ui is a UI library that pursues simple and efficient data rendering f
15
15
  [![NPM Downloads][npm-downloads-image]][npm-downloads-url]
16
16
  [![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer]
17
17
 
18
-
19
- ```html
20
- <head>
21
- <title>API Renderer Demo</title>
22
- <link rel="stylesheet" href="./api-render-ui.css">
23
- </head>
24
- <body>
25
- <div id="apiContainer"></div>
26
- <script src="./api-render-ui.js"></script>
27
-
28
- <script>
29
- const apiRenderer = new ApiRenderer({
30
- mountPoint: '#apiContainer',
31
- });
32
-
33
- const openapiSpec = {...};
34
-
35
- apiRenderer.render(openapiSpec);
36
- </script>
37
- </body>
18
+ ### Usage in typescript project
19
+ - Please install first
20
+ ```
21
+ npm install api-render-ui
22
+ ```
23
+ - Your typescript code
24
+ ```typescript
25
+ import { ApiRenderer } from "api-render-ui"
26
+
27
+ const apiRenderer = new ApiRenderer({
28
+ mountPoint: '#notebook', // 可以是选择器字符串
29
+ });
30
+ // 执行渲染
31
+ apiRenderer.render(openapiSpec);
38
32
  ```
33
+ ### Usage in single html
34
+ Please refer to [example](example/animal.html)
39
35
 
40
36
  ## Installation
41
37