File tree Expand file tree Collapse file tree 4 files changed +84
-16
lines changed
docs/src/document/zh-CN/components
packages/json-schema-form Expand file tree Collapse file tree 4 files changed +84
-16
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,67 @@ export default defineConfig({
59
59
});
60
60
```
61
61
62
+ ::: title 在线安装
63
+ :::
64
+
65
+ ::: describe 根据不同的 CDN 提供商有不同的引入方式,我们在这里以 unpkg 举例。
66
+ :::
67
+
68
+ ``` html
69
+ <!DOCTYPE html>
70
+ <html lang =" en" >
71
+ <head >
72
+ <meta charset =" UTF-8" />
73
+ <link rel =" stylesheet" href =" //unpkg.com/@layui/json-schema-form/lib/index.css" />
74
+ <script src =" //unpkg.com/vue@3" ></script >
75
+ <script src =" //unpkg.com/@layui/json-schema-form" ></script >
76
+ </head >
77
+ <body >
78
+ <div id =" app" >
79
+ {{message}}
80
+ <lay-json-schema-form :model =" form" :schema =" schema" ></lay-json-schema-form >
81
+ </div >
82
+
83
+ <script >
84
+ const { createApp , ref , reactive } = Vue
85
+
86
+ const app = createApp ({
87
+ setup () {
88
+ const message = reactive (' Hello vue!' )
89
+ const form = ref ({})
90
+ const schema = reactive ({
91
+ name: {
92
+ label: ' 姓名' ,
93
+ type: ' input' ,
94
+ props: {
95
+ type: ' text' ,
96
+ placeholder: ' 请输入姓名' ,
97
+ }
98
+ },
99
+ password: {
100
+ label: ' 密码' ,
101
+ type: ' input' ,
102
+ props: {
103
+ type: ' password' ,
104
+ autocomplete: " off" ,
105
+ placeholder: ' 请输入密码' ,
106
+ }
107
+ },
108
+ })
109
+ return {
110
+ message,
111
+ schema,
112
+ form,
113
+ }
114
+ }
115
+ })
116
+ app .use (LayuiJsonSchemaForm)
117
+ app .mount (' #app' )
118
+ </script >
119
+ </body >
120
+ </html >
121
+ ```
122
+
62
123
::: title 基本使用
63
124
:::
64
125
Original file line number Diff line number Diff line change
1
+ ## [ 1.0.16] (2025-05-17)
2
+
3
+ ### Layui-vue Upgrade V2.22.2
4
+
5
+ ### Bug Fixes
6
+ * 具名导出 ` install ` 函数
7
+
1
8
## [ 1.0.15] (2024-10-22)
2
9
3
10
### Layui-vue Upgrade V2.19.0
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @layui/json-schema-form" ,
3
- "version" : " 1.0.15" ,
4
- "description" : " Json-schema-form is a high-level component encapsulated on the basis of @layui/layui-vue form." ,
5
- "homepage" : " http://www.layui-vue.com/zh-CN/components/jsonSchemaForm" ,
6
3
"type" : " module" ,
7
- "module " : " lib/json-schema-form.js " ,
8
- "main " : " lib/json -schema-form.umd.js " ,
4
+ "version " : " 1.0.16 " ,
5
+ "description " : " Json -schema-form is a high-level component encapsulated on the basis of @layui/layui-vue form. " ,
9
6
"license" : " MIT" ,
7
+ "homepage" : " http://www.layui-vue.com/zh-CN/components/jsonSchemaForm" ,
10
8
"bugs" : {
11
9
"url" : " https://gitee.com/layui-vue/layui-vue/issues"
12
10
},
11
+ "keywords" : [
12
+ " layui-vue" ,
13
+ " layui" ,
14
+ " layui/json-schema-form" ,
15
+ " vue"
16
+ ],
13
17
"exports" : {
14
18
"." : {
15
19
"import" : {
22
26
" ./types/*.d.ts"
23
27
]
24
28
},
29
+ "main" : " lib/json-schema-form.umd.js" ,
30
+ "module" : " lib/json-schema-form.js" ,
25
31
"types" : " types/index.d.ts" ,
26
32
"style" : " lib/index.css" ,
27
- "keywords" : [
28
- " layui-vue" ,
29
- " layui" ,
30
- " layui/json-schema-form" ,
31
- " vue"
32
- ],
33
33
"files" : [
34
34
" lib" ,
35
35
" types"
Original file line number Diff line number Diff line change 1
1
import type { App } from "vue" ;
2
- import type { InstallOptions } from "./types" ;
2
+ // import type { InstallOptions } from "./types";
3
3
4
4
import LayJsonSchemaForm from "./component/form/index" ;
5
5
6
6
// 全局安装
7
- const install = ( app : App , options ?: InstallOptions ) : void => {
8
- app . component ( LayJsonSchemaForm . name , LayJsonSchemaForm ) ;
9
- } ;
7
+ function install ( app : App ) : void {
8
+ app . component ( LayJsonSchemaForm . name ! , LayJsonSchemaForm ) ;
9
+ }
10
10
11
- export { LayJsonSchemaForm } ;
11
+ export { install , LayJsonSchemaForm } ;
12
12
13
13
export default { install } ;
You can’t perform that action at this time.
0 commit comments