1 Star 0 Fork 0

daimkdl / el-form-renderer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

el-form-renderer

Build Status NPM Download NPM Version NPM License PRs Welcome Automated Release Notes by gren

Table of Contents

Introduction

我们 github 有这些组件,它们并非孤立的,而是有关联的

我们开发的表单相关的组件都可以配合 @femessage/el-form-renderer(以下简称为 el-form-renderer)使用

可以说 el-form-renderer 是核心,扮演着枢纽的角色

内部集成

el-data-table、el-data-tree 等组件内部集成该组件,用于更加灵活的配置内部表单渲染的场景。

以 el-data-table 为例,我们知道通过 el-data-table 可以快速生成一个列表的 CRUD 页面。而其中的搜索框,新增编辑的内容弹框,就是由 el-form-renderer 生成的。通过传入对应的配置项,就能生成相应的内容,不需要写 template。

外部扩展

在一些表单项场景,el-form-renderer 可用于表单项进行扩展。

自定义组件按一定的格式实现 v-model,就能让 el-form-render 能渲染自定义组件

如下图所示,两个图片上传、一个富文本编辑器,都是借助 el-form-renderer 渲染的。

example.png

Feature

  • 只需进行简单的配置,即可实现常用表单功能
  • 支持 setOptions 方法,动态改变 select 的 options
  • content 支持 inputFormatoutputFormattrim,对组件输入输出值处理
  • 支持 on 进行事件监听,处理表单数据联动
  • 支持 hidden 进行表单项动态显示与隐藏
  • 支持渲染自定义组件
  • 支持自定义组件设置校验规则

⬆ Back to Top

Links

⬆ Back to Top

Quick Start

# Step1 确认你已经正确安装并使用了 element-ui
yarn add @femessage/el-form-renderer
<template>
  <el-form-renderer :content="content"></el-form-renderer>
</template>

<script>
  import ElFormRenderer from '@femessage/el-form-renderer'

  export default {
    components: {
      ElFormRenderer
    },
    data() {
      return {
        content: []
      }
    }
  }
</script>

⬆ Back to Top

Inspiration

thanks to element-patch

Contributing

For those who are interested in contributing to this project, such as:

  • report a bug
  • request new feature
  • fix a bug
  • implement a new feature

Please refer to our contributing guide.

⬆ Back to Top

Contributors

Thanks goes to these wonderful people (emoji key):

Alvin
Alvin

💻 👀 🐛 📝 🤔
levy
levy

👀 🚇 🤔
EVILLT
EVILLT

💻 🐛 📝 🤔
Donald Shen
Donald Shen

📖 💡
ColMugX
ColMugX

💻 ⚠️ 📖
OuZuYu
OuZuYu

🐛

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT

⬆ Back to Top

MIT License Copyright (c) 2017 Daniel Li Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

A data-driven dynamic and complex form solution 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/dhopen/el-form-renderer.git
git@gitee.com:dhopen/el-form-renderer.git
dhopen
el-form-renderer
el-form-renderer
master

搜索帮助