@zeng-alt/formkit-form-builder 0.1.1 → 0.1.3
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 +24 -19
- package/package.json +7 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ pnpm i vue naive-ui @vueuse/core
|
|
|
17
17
|
## 样式引入
|
|
18
18
|
|
|
19
19
|
```ts
|
|
20
|
-
import
|
|
20
|
+
import "@zeng-alt/formkit-form-builder/style.css";
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## 快速开始
|
|
@@ -28,25 +28,25 @@ import '@zeng-alt/formkit-form-builder/style.css'
|
|
|
28
28
|
|
|
29
29
|
```ts
|
|
30
30
|
// main.ts
|
|
31
|
-
import { createApp } from
|
|
32
|
-
import { plugin as formkitPlugin } from
|
|
33
|
-
import App from
|
|
34
|
-
import formkitConfig from
|
|
31
|
+
import { createApp } from "vue";
|
|
32
|
+
import { plugin as formkitPlugin } from "@formkit/vue";
|
|
33
|
+
import App from "./App.vue";
|
|
34
|
+
import formkitConfig from "./formkit.config";
|
|
35
35
|
|
|
36
|
-
createApp(App).use(formkitPlugin, formkitConfig).mount(
|
|
36
|
+
createApp(App).use(formkitPlugin, formkitConfig).mount("#app");
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
### 2) 使用 FormBuilder
|
|
40
40
|
|
|
41
41
|
```vue
|
|
42
42
|
<script setup lang="ts">
|
|
43
|
-
import { FormBuilder, BuilderProvider } from
|
|
44
|
-
import
|
|
43
|
+
import { FormBuilder, BuilderProvider } from "formkit-form-builder";
|
|
44
|
+
import "formkit-form-builder/style.css";
|
|
45
45
|
|
|
46
46
|
const config = {
|
|
47
|
-
locale:
|
|
48
|
-
apiKey:
|
|
49
|
-
}
|
|
47
|
+
locale: "zh-CN",
|
|
48
|
+
apiKey: "",
|
|
49
|
+
};
|
|
50
50
|
</script>
|
|
51
51
|
|
|
52
52
|
<template>
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
FormBuilderProvider,
|
|
68
68
|
useFormBuilderConfig,
|
|
69
69
|
provideFormBuilderConfig,
|
|
70
|
-
} from
|
|
70
|
+
} from "formkit-form-builder";
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
- `FormBuilder`:主组件(设计器 UI)。
|
|
@@ -78,9 +78,9 @@ import {
|
|
|
78
78
|
|
|
79
79
|
```ts
|
|
80
80
|
export interface FormBuilderConfig {
|
|
81
|
-
apiKey?: string
|
|
82
|
-
locale?: string
|
|
83
|
-
messages?: Record<string, any
|
|
81
|
+
apiKey?: string;
|
|
82
|
+
locale?: string;
|
|
83
|
+
messages?: Record<string, any>;
|
|
84
84
|
}
|
|
85
85
|
```
|
|
86
86
|
|
|
@@ -92,15 +92,15 @@ export interface FormBuilderConfig {
|
|
|
92
92
|
|
|
93
93
|
```ts
|
|
94
94
|
const config = {
|
|
95
|
-
locale:
|
|
95
|
+
locale: "zh-CN",
|
|
96
96
|
messages: {
|
|
97
|
-
|
|
97
|
+
"zh-CN": {
|
|
98
98
|
builder: {
|
|
99
|
-
clearForm:
|
|
99
|
+
clearForm: "清空当前表单",
|
|
100
100
|
},
|
|
101
101
|
},
|
|
102
102
|
},
|
|
103
|
-
}
|
|
103
|
+
};
|
|
104
104
|
```
|
|
105
105
|
|
|
106
106
|
## 示例
|
|
@@ -143,4 +143,9 @@ pnpm publish --access public
|
|
|
143
143
|
```bash
|
|
144
144
|
pnpm install
|
|
145
145
|
pnpm dev
|
|
146
|
+
|
|
147
|
+
pnpm version patch # 1.0.0 → 1.0.1
|
|
148
|
+
pnpm version minor # 1.0.0 → 1.1.0
|
|
149
|
+
pnpm version major # 1.0.0 → 2.0.0
|
|
150
|
+
pnpm publish
|
|
146
151
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeng-alt/formkit-form-builder",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "A visual FormKit schema builder for Vue 3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,8 +43,14 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@internationalized/date": "^3.12.0",
|
|
46
|
+
"@codemirror/commands": "^6.8.1",
|
|
47
|
+
"@codemirror/lang-javascript": "^6.2.4",
|
|
48
|
+
"@codemirror/state": "^6.5.2",
|
|
49
|
+
"@codemirror/theme-one-dark": "^6.1.3",
|
|
50
|
+
"@codemirror/view": "^6.38.2",
|
|
46
51
|
"class-variance-authority": "^0.7.1",
|
|
47
52
|
"clsx": "^2.1.1",
|
|
53
|
+
"axios": "^1.12.2",
|
|
48
54
|
"openai": "^6.34.0",
|
|
49
55
|
"vue-sonner": "^2.0.9",
|
|
50
56
|
"@formkit/core": "^2.0.0",
|