# vue-ele-form-data-editor

> vue-ele-form 的极简数据编辑器

Latest version **0.1.6** (published 2020-08-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-ele-form-data-editor
pnpm add vue-ele-form-data-editor
yarn add vue-ele-form-data-editor
bun add vue-ele-form-data-editor
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2020-08-27 |
| First published | 2020-08-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 14.7 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | zhangchaojie |
| Keywords | vue-ele-form-data-editor, vue-ele-form, vue data editor |

## Links

- npm: https://www.npmjs.com/package/vue-ele-form-data-editor
- Repository: https://github.com/dream2023/vue-ele-form-data-editor
- Homepage: https://github.com/dream2023/vue-ele-form-data-editor/
- Issues: https://github.com/dream2023/vue-ele-form-data-editor/issues
- npm.io page: https://npm.io/package/vue-ele-form-data-editor

## Dependencies (1)

- [serialize-javascript](https://npm.io/package/serialize-javascript.md) ^4.0.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.6 (latest) — 2020-08-27
- 0.1.5 — 2020-08-26
- 0.1.4 — 2020-08-25
- 0.1.3 — 2020-08-23
- 0.1.2 — 2020-08-23
- 0.1.1 — 2020-08-23
- 0.1.0 — 2020-08-23

## README

# vue-ele-form-data-editor | vue-ele-form 的极简数据编辑器

[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg)](https://opensource.org/licenses/mit-license.php)
[![npm](https://img.shields.io/npm/v/vue-ele-form-data-editor.svg)](https://www.npmjs.com/package/vue-ele-form-data-editor)
[![download](https://img.shields.io/npm/dw/vue-ele-form-data-editor.svg)](https://npmcharts.com/compare/vue-ele-form-data-editor?minimal=true)

## 介绍

![image](https://s1.ax1x.com/2020/08/23/dws9Qe.gif)

## 安装

```bash
yarn add vue-ele-form-data-editor
```

或者

```bash
npm install vue-ele-form-data-editor --save
```

## 注册和使用

### 全局注册

```js
import EleForm from "vue-ele-form";
import EleFormDataEditor from "vue-ele-form-data-editor";

// 注册 data-editor 组件
Vue.component("data-editor", EleFormDataEditor);

// 注册 ele-form
Vue.use(EleForm, {
  // 专门设置全局的 data-editor 属性
  "data-editor": {
    types: ["array", "object"],
    autoSave: false,
    // 其它属性，同 element input 组件
    // https://element.eleme.cn/#/zh-CN/component/input
    rows: 8
  }
});
```

### 局部注册

局部注册和使用请参考: [https://www.yuque.com/chaojie-vjiel/vbwzgu/inlpxy#I5kdQ](https://www.yuque.com/chaojie-vjiel/vbwzgu/inlpxy#I5kdQ)

### 使用

```js
formDesc: {
  xxx: {
    label: 'xxx',
    // 只需要在这里指定为 data-editor 即可
    type: 'data-editor',
    attrs: {
      types: ['function', 'promise'],
      // 其它属性，同 element input 组件
      // https://element.eleme.cn/#/zh-CN/component/input
      rows: 8
    }
  }
}
```

## 示例

```html
<template>
  <el-card
    header="ele-form-data-editor 演示"
    shadow="never"
    style="max-width: 1250px;min-height: 1000px;margin: 20px auto;"
  >
    <ele-form
      :form-data="formData"
      :form-desc="formDesc"
      :span="22"
      :request-fn="handleRequest"
      @request-success="handleSuccess"
    ></ele-form>
  </el-card>
</template>

<script>
  export default {
    data() {
      return {
        formData: {
          comic: []
        },
        formDesc: {
          comic: {
            type: "data-editor",
            label: "动漫",
            attrs: {
              types: ["array"]
            }
          }
        }
      };
    },
    methods: {
      handleRequest(data) {
        console.log(data);
        return Promise.resolve();
      },
      handleSuccess() {
        this.$message.success("提交成功");
      }
    }
  };
</script>

<style>
  body {
    background-color: #f0f2f5;
  }
</style>
```

### attrs

### 参数概述

```js
attrs: {
  // 数据类型列表
  types: {
    type: Array;
  },
  // 是否在是去焦点时自动保存，默认为 true
  autoSave: {
    type: Boolean,
    default: true
  },
  // 其它属性，同 element input 组件
  // https://element.eleme.cn/#/zh-CN/component/input
}
```

## 相关链接

- [vue-ele-form](https://github.com/dream2023/vue-ele-form)
- [element-ui](https://element.eleme.cn/#/zh-CN/component/input)

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