# noir-form-render

> vue3-form-render 基于Vue3.x，使用JSON Schema快速生成自定义

Latest version **0.2.1** (published 2023-03-16) · 0 weekly downloads

## Install

```sh
npm install noir-form-render
pnpm add noir-form-render
yarn add noir-form-render
bun add noir-form-render
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2023-03-16 |
| First published | 2023-03-11 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 800.8 KB |
| Known vulnerabilities | 0 (+6 in 2 direct dependencies) |
| Install scripts | no |
| Maintainers | shiyizhou |

## Links

- npm: https://www.npmjs.com/package/noir-form-render
- npm.io page: https://npm.io/package/noir-form-render

## Dependencies (9)

- [vue](https://npm.io/package/vue.md) ^3.0.0
- [xlsx](https://npm.io/package/xlsx.md) ^0.16.9
- [dayjs](https://npm.io/package/dayjs.md) ^1.10.3
- [moment](https://npm.io/package/moment.md) ^2.29.1
- [core-js](https://npm.io/package/core-js.md) ^3.6.5
- [validator](https://npm.io/package/validator.md) ^13.5.2
- [wangeditor](https://npm.io/package/wangeditor.md) ^4.6.2
- [ant-design-vue](https://npm.io/package/ant-design-vue.md) ^2.0.0-rc.7
- [@babel/eslint-parser](https://npm.io/package/@babel/eslint-parser.md) ^7.19.1

## Recent versions

- 0.2.1 (latest) — 2023-03-16
- 0.1.3 — 2023-03-16
- 0.1.2 — 2023-03-16
- 0.1.1 — 2023-03-11

## README

<p align="center">    
<img width=350 align= "center" alt="logo" src="https://user-images.githubusercontent.com/21073039/104408849-ef6d2280-559f-11eb-93e4-fed00748e4b6.png" />
</p>   
<h1 align= "center">vue3-form-render</h1>
基于Vue3.x，使用JSON Schema快速生成自定义表单配置接口
## examples

[form-render live Demo](https://muwoo.github.io/vue-form-render/)

![image](https://user-images.githubusercontent.com/21073039/104298169-a1541280-54fe-11eb-9e16-da4414962293.png)


## install
```shell
npm i vue3-form-render --save
```
`vue3 form render` depend on [Ant Design of Vue](https://2x.antdv.com/docs/vue/introduce-cn/)
to render from items.so before we use `vue3 form render` we need to install `Ant Design of Vue` and import it to our project:
```js
import { createApp } from 'vue'
import App from './App.vue'

import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/antd.css';

const app = createApp(App);
app.use(Antd);
app.mount('#app');
```

## easy demo

```vue
<template>
  <div>
    <formRender
      :schema="schema"
      :formData="formData"
      @on-change="change"
      @on-validate="validate"
    />
  </div>
</template>

<script>
import {reactive, toRefs} from 'vue';

// render index
import FormRender from 'vue3-form-render';
// form render style
import 'vue3-form-render/lib/vue3-form-render.css';

export default {
  name: 'App',
  setup() {
    const state = reactive({
      schema: {
        type: 'object',
        properties: {
          string: {
            title: 'string',
            type: 'string',
            maxLength: 4,
            'ui:options': {
              placeholder: 'enter more than 4 characters',
            },
          }
        },
      },
      formData: {
        string: 'aaa'
      },
    });

    const change = (v) => {
      state.formData = v;
      console.log(v);
    }
    const validate = (v) => {
      console.log(v);
    }

    return {
      ...toRefs(state),
      change,
      validate,
    }
  },
  components: {
    FormRender,
  }
}
</script>

```

## Documentation
For extensive documentation see the examples folder or read it on [vue3-form-render](https://muwoo.github.io/vue-form-render)


## API

### Props
|  Property   | Description  | Type | Default|
|  ----  | ----  | ---- | ---- |
| schame  | JSON Schema | object | -- |
| formData  | formData | object | -- |

### Events

|  Events Name	   | Description  | Arguments | 
|  ----  | ----  | ---- |
| on-change  | Callback function for user to trigger form update | function(value: formData) |
| on-validate  | Validation callback function for user to trigger form update | function(value: validates) |

## Special thanks

this Project inspiration from [form-render](https://x-render.gitee.io/form-render/guide/design) 
but There is no similar framework for Vue 3.x


## License
This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/muwoo/vue-form-render/blob/master/LICENSE) file for details.

---
_Source: https://npm.io/package/noir-form-render · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
