# k-form-design-ext

> 基于k-form-design进行的儿此扩展

Latest version **3.7.4** (published 2021-02-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install k-form-design-ext
pnpm add k-form-design-ext
yarn add k-form-design-ext
bun add k-form-design-ext
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.7.4 |
| Published | 2021-02-05 |
| First published | 2021-02-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Unpacked size | 17.3 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1247 |
| Author | kchengz |
| Maintainers | q495265366 |
| Keywords | ant-design, form, k-form-design, 表单设计器, 表单设计, 可视化, 工作流 |

## Links

- npm: https://www.npmjs.com/package/k-form-design-ext
- Repository: https://github.com/Kchengz/k-form-design
- Homepage: https://github.com/Kchengz/k-form-design#readme
- Issues: https://github.com/Kchengz/k-form-design/issues
- npm.io page: https://npm.io/package/k-form-design-ext

## Dependencies (11)

- [vue](https://npm.io/package/vue.md) ^2.6.10
- [moment](https://npm.io/package/moment.md) ^2.24.0
- [core-js](https://npm.io/package/core-js.md) ^2.6.5
- [clipboard](https://npm.io/package/clipboard.md) ^2.0.6
- [vue-router](https://npm.io/package/vue-router.md) ^3.0.3
- [vuedraggable](https://npm.io/package/vuedraggable.md) ^2.23.2
- [babel-polyfill](https://npm.io/package/babel-polyfill.md) ^6.26.0
- [vue-quill-editor](https://npm.io/package/vue-quill-editor.md) ^3.0.6
- [babel-plugin-import](https://npm.io/package/babel-plugin-import.md) ^1.13.0
- [vue-codemirror-lite](https://npm.io/package/vue-codemirror-lite.md) ^1.0.4
- [default-passive-events](https://npm.io/package/default-passive-events.md) ^1.0.10

## 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

- 3.7.4 (latest) — 2021-02-05
- 3.7.3 — 2021-02-04
- 3.7.2 — 2021-02-04

## README

# 表单设计器 k-form-design

<p align="center">
  <a href="https://github.com/vuejs/vue">
    <img src="https://img.shields.io/badge/vue-2.6.10-brightgreen.svg" alt="vue">
  </a>
  <a href="https://github.com/vueComponent/ant-design-vue">
    <img src="https://img.shields.io/badge/Ant%20Design%20Vue-1.5.1-blue" alt="ant-design-vue">
  </a>
  <a href="https://github.com/Kchengz/k-form-design/blob/master/LICENSE">
    <img src="https://img.shields.io/github/license/mashape/apistatus.svg" alt="license">
  </a>
</p>

![](http://cdn.kcz66.com/demo.gif)

## 简介

本扩展是在k-form-design基础上做了部分扩展修改，
扩展属性有：appendAttr，notAppendAttr
扩展方法有：getJson()


## 使用方式
```vue
<template>
  <div>
    <k-form-design ref="kdf" :appendAttr="appendAttr" />
    <div @click="getData()">
      点击我获取JSON
    </div>
  </div>
</template>
<script>
export default {
  name: "Index",
  props: {
    val: {
      default: null,
      type: String
    }
  },
  data() {
    return {
      appendAttr: [
        {
          /* 键名 */
          key: "unit",
          /* 渲染组件 */
          rend: require("./unit").default,
          /* true代表所有控件追加，数组代表指定那些控件追加 */
          field: true
        }
      ]
    };
  },
  watch: {},
  mounted() {},
  methods: {
    getData() {
      const data = this.$refs["kdf"].getJson();
      console.log(data);
      /* {
        "list": [
          {
            "type": "input",
            "label": "输入框",
            "options": {
              "type": "text",
              "width": "100%",
              "defaultValue": "",
              "placeholder": "请输入",
              "clearable": false,
              "maxLength": null,
              "hidden": false,
              "disabled": false
            },
            "model": "input_1612430608558",
            "key": "input_1612430608558",
            "rules": [
              {
                "required": false,
                "message": "必填项"
              }
            ],
            "unit": "我是单位"
          }
        ],
        "config": {
          "layout": "horizontal",
          "labelCol": {
            "xs": 4,
            "sm": 4,
            "md": 4,
            "lg": 4,
            "xl": 4,
            "xxl": 4
          },
          "wrapperCol": {
            "xs": 18,
            "sm": 18,
            "md": 18,
            "lg": 18,
            "xl": 18,
            "xxl": 18
          },
          "hideRequiredMark": false,
          "customStyle": ""
        }
      }
      */
    }
  }
};
</script>
```

## 扩展属性如何编写组件，以下是一个组件是实例

```vue
<template>
  <div>
    单位：
    <input v-model="value" />
  </div>
</template>
<script>
export default {
  name: "Unit",
  props: {
    val: {
      default: "",
      type: String
    }
  },
  data() {
    return {
      value: ""
    };
  },
  watch: {
    value: function(val) {
      this.$emit("update:val", val);
    },
    val: function(val) {
      if (val !== this.value) {
        this.value = val;
      }
    }
  },
  mounted() {
    this.$emit("update:val", this.value);
  },
  methods: {}
};
</script>
```

## 如何安装与引用请前往k-form-design原组件进行查阅文档。

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