@formvk/vue 1.0.0 → 1.1.0
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/CHANGELOG.md +12 -0
- package/README.md +2 -0
- package/README.zh-CN.md +65 -0
- package/dist/index.js +451 -322
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
# [1.1.0](https://github.com/formvk/core/compare/v1.0.0...v1.1.0) (2026-11-16)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- 为所有包添加中英双语 README 文件并导出 reactive-react 包 ([22f7b77](https://github.com/formvk/core/commit/22f7b7751e636d4aa8fbc844ec9b286414d4a14f))
|
|
11
|
+
- **schema:** 为 createSchema 增加显式值类型注入的重载 ([d6322b6](https://github.com/formvk/core/commit/d6322b65405bb8ac8b731320c6e5089276345769))
|
|
12
|
+
|
|
1
13
|
# @formvk/vue
|
|
2
14
|
|
|
3
15
|
## 1.0.0
|
package/README.md
CHANGED
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# @formvk/vue
|
|
2
|
+
|
|
3
|
+
[English](./README.md) | [简体中文](./README.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
Formvk 的 Vue 3 绑定。它通过响应式渲染器与组合式函数,把 `@formvk/core` 的表单模型和 `@formvk/schema` 连接到 Vue 组件。
|
|
6
|
+
|
|
7
|
+
## 安装
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @formvk/vue vue
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
`vue`(`^3.5.0`)是 peer 依赖。
|
|
14
|
+
|
|
15
|
+
## 使用
|
|
16
|
+
|
|
17
|
+
```vue
|
|
18
|
+
<script setup lang="ts">
|
|
19
|
+
import { createForm, createFragment, createSchema, FormProvider, SchemaField } from '@formvk/vue'
|
|
20
|
+
|
|
21
|
+
import MyInput from './MyInput.vue'
|
|
22
|
+
|
|
23
|
+
const form = createForm({ values: { name: '' } })
|
|
24
|
+
const f = createFragment()
|
|
25
|
+
const schema = createSchema({
|
|
26
|
+
name: f.Field({ title: 'Name', component: 'Input' }),
|
|
27
|
+
})
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<FormProvider :form="form">
|
|
32
|
+
<SchemaField :schema="schema" :components="{ Input: MyInput }" />
|
|
33
|
+
</FormProvider>
|
|
34
|
+
</template>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
也可以用 `createSchemaField` 预绑定组件:
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
import { createSchema, createSchemaField } from '@formvk/vue'
|
|
41
|
+
|
|
42
|
+
const { SchemaField, fragment: f } = createSchemaField({
|
|
43
|
+
components: { Input: MyInput },
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
const schema = createSchema({
|
|
47
|
+
name: f.Input({ title: 'Name' }),
|
|
48
|
+
})
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## API
|
|
52
|
+
|
|
53
|
+
- **组件** — `FormProvider`、`SchemaField`、`createSchemaField`、`RecursionField`、`ExpressionScope`、`FormConsumer`。
|
|
54
|
+
- **Hooks** — `useForm`、`useField`、`useFieldSchema`、`useAttach`、`useFormEffects`、`useInjectionCleaner`、`useParentForm`。
|
|
55
|
+
- **辅助函数** — `createForm`、`connect`、`mapProps`、`mapReadPretty`。
|
|
56
|
+
- **Schema** — 重新导出 `@formvk/schema`(`createFragment`、`createSchema`、`ISchema`、表达式类型等)。
|
|
57
|
+
|
|
58
|
+
## 文档
|
|
59
|
+
|
|
60
|
+
- Vue API:https://formvk.github.io/core/zh/api/vue
|
|
61
|
+
- 快速上手:https://formvk.github.io/core/zh/guide/getting-started
|
|
62
|
+
|
|
63
|
+
## License
|
|
64
|
+
|
|
65
|
+
MIT
|