@leiyin/v-form-renderer 0.1.3-alpha.3 → 1.0.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/README.md +55 -0
- package/dist/index.cjs.css +1 -1
- package/dist/index.cjs.js +775 -6
- package/dist/index.d.ts +226 -6
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +776 -8
- package/dist/types/components/RenderFormGroup.vue.d.ts +73 -0
- package/dist/types/components/RenderFormItem.vue.d.ts +63 -0
- package/dist/types/components/render-component.d.ts +4 -0
- package/dist/types/components/render-form-item.d.ts +23 -0
- package/dist/types/hooks/index.d.ts +8 -0
- package/dist/types/hooks/useFormContext.d.ts +3 -0
- package/dist/types/hooks/useFormEvents.d.ts +11 -0
- package/dist/types/hooks/useFormMethods.d.ts +8 -0
- package/dist/types/hooks/useFormState.d.ts +17 -0
- package/dist/types/index.d.ts +2 -3
- package/dist/types/types/form.d.ts +111 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts +37 -0
- package/dist/types/v-form-renderer.d.ts +29 -0
- package/dist/types/v-form-renderer.vue.d.ts +81 -1
- package/package.json +14 -2
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.esm.js.map +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# @leiyin/v-form-renderer
|
|
2
|
+
|
|
3
|
+
一个基于 **Vue 3 + Element Plus** 的配置化表单渲染组件,用于通过 JSON / Schema 快速生成复杂表单。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## ✨ 特性
|
|
8
|
+
|
|
9
|
+
- ⚡️ 基于 Vue 3 Composition API
|
|
10
|
+
- 🧩 配置驱动(JSON Schema)
|
|
11
|
+
- 🎯 内置 Element Plus 表单组件
|
|
12
|
+
- 📦 支持 ESM / CJS 双构建
|
|
13
|
+
- 🧠 完整 TypeScript 类型支持
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 📦 安装
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pnpm add @leiyin/v-form-renderer
|
|
21
|
+
# 或
|
|
22
|
+
npm install @leiyin/v-form-renderer
|
|
23
|
+
# 或
|
|
24
|
+
yarn add @leiyin/v-form-renderer
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 🚀 快速开始
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
<template>
|
|
31
|
+
<VFormRenderer :content="schema" />
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script setup lang="ts">
|
|
35
|
+
import { ref } from 'vue'
|
|
36
|
+
|
|
37
|
+
const schema = ref([
|
|
38
|
+
{
|
|
39
|
+
type: 'input',
|
|
40
|
+
label: '用户名',
|
|
41
|
+
prop: 'username'
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
type: 'select',
|
|
45
|
+
label: '角色',
|
|
46
|
+
prop: 'role',
|
|
47
|
+
options: [
|
|
48
|
+
{ label: '管理员', value: 'admin' },
|
|
49
|
+
{ label: '普通用户', value: 'user' }
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
])
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
```
|
package/dist/index.cjs.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.el-form-renderer{.el-form-item{.el-form-item__content{&>.el-input{&>input[readonly][data-v-3f4b8568]{background-color:transparent;border:none;color:#606266}}&>.el-date-editor>input[disabled][data-v-3f4b8568],&>.el-textarea>textarea[readonly][data-v-3f4b8568]{background-color:transparent;border:none;color:#606266}}.no-label-form-item{.el-form-item__content[data-v-3f4b8568]{margin-left:0!important}}}}
|