jervis-form 0.0.0-alpha.0 → 0.0.0-alpha.2

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
@@ -24,6 +24,61 @@ Make sure these are installed in your app:
24
24
  npm run build
25
25
  ```
26
26
 
27
+ ## Documentation (VitePress)
28
+
29
+ Run docs locally:
30
+
31
+ ```bash
32
+ npm run docs:dev
33
+ ```
34
+
35
+ Build docs for static hosting:
36
+
37
+ ```bash
38
+ npm run docs:build
39
+ npm run docs:preview
40
+ ```
41
+
42
+ ## Custom Input Registration
43
+
44
+ Register custom field components globally with the plugin:
45
+
46
+ ```js
47
+ import { createApp } from "vue";
48
+ import App from "./App.vue";
49
+ import { JervisFormPlugin } from "jervis-form";
50
+ import MyCustomInput from "./components/MyCustomInput.vue";
51
+
52
+ const app = createApp(App);
53
+
54
+ app.use(JervisFormPlugin, {
55
+ customFieldTypes: {
56
+ myCustomInput: MyCustomInput,
57
+ },
58
+ });
59
+ ```
60
+
61
+ Then use it in your schema:
62
+
63
+ ```js
64
+ const schema = [
65
+ {
66
+ type: "myCustomInput",
67
+ key: "customValue",
68
+ label: "Custom Value",
69
+ },
70
+ ];
71
+ ```
72
+
73
+ You can also register custom fields locally on a single GenericForm instance:
74
+
75
+ ```vue
76
+ <GenericForm
77
+ :schema="schema"
78
+ :customFieldTypes="{ myCustomInput: MyCustomInput }"
79
+ />
80
+ ```
81
+
27
82
  ## Publish Checklist
28
83
 
29
84
  ```bash