jervis-form 0.0.0-alpha.0 → 0.0.0-alpha.1
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 +40 -0
- package/dist/jervis-form.js +1190 -1113
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -24,6 +24,46 @@ Make sure these are installed in your app:
|
|
|
24
24
|
npm run build
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
+
## Custom Input Registration
|
|
28
|
+
|
|
29
|
+
Register custom field components globally with the plugin:
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
import { createApp } from "vue";
|
|
33
|
+
import App from "./App.vue";
|
|
34
|
+
import { JervisFormPlugin } from "jervis-form";
|
|
35
|
+
import MyCustomInput from "./components/MyCustomInput.vue";
|
|
36
|
+
|
|
37
|
+
const app = createApp(App);
|
|
38
|
+
|
|
39
|
+
app.use(JervisFormPlugin, {
|
|
40
|
+
customFieldTypes: {
|
|
41
|
+
myCustomInput: MyCustomInput,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Then use it in your schema:
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
const schema = [
|
|
50
|
+
{
|
|
51
|
+
type: "myCustomInput",
|
|
52
|
+
key: "customValue",
|
|
53
|
+
label: "Custom Value",
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
You can also register custom fields locally on a single GenericForm instance:
|
|
59
|
+
|
|
60
|
+
```vue
|
|
61
|
+
<GenericForm
|
|
62
|
+
:schema="schema"
|
|
63
|
+
:customFieldTypes="{ myCustomInput: MyCustomInput }"
|
|
64
|
+
/>
|
|
65
|
+
```
|
|
66
|
+
|
|
27
67
|
## Publish Checklist
|
|
28
68
|
|
|
29
69
|
```bash
|