npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

element-ui-render-form

v1.0.0

Published

A component with element-ui for form.

Downloads

5

Readme

element-ui-render-form

简介

element-ui-render-form是一个基于element-ui组件之上的自定义封装组件。

在使用element-ui时,其form及相关组件(form-item, input, select, date-picker等)在渲染大量表单时使用起来非常麻烦,尤其是template的复杂配置。

element-ui-render-form就是一个为了简化element-uiform组件的使用而开发的组件,在渲染大量表单时非常的好用。

安装

element-ui-render-form依赖vue2.5+element-ui 2.0+

npm i element-ui-render-form -S

项目引入

import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import ElRenderForm from 'element-ui-render-form'
import App from './App.vue'

Vue.use(ElementUI)
Vue.use(ElRenderForm)

new Vue({
  el: '#app',
  render: h => h(App)
})

配置

props

| 参数 | 说明 | 类型 | 可选值 | 默认值 | |-----|-----|------|-------|-------| | data | 表单数据双向绑定的对象 | object | - | - | | fileds | 表单各项配置对象(key要对应data上各项的key) | object | - | - | | orders | 表单各项排序 | array | - | 按照fileds顺序排序 | | edit | 表单是否为编辑状态 | boolean | - | false |

fileds 配置项

| 参数 | 说明 | 类型 | 可选值 | 默认值 | |-----|-----|------|-------|-------| | label | 表单的label显示内容 | string | - | - | | type | 编辑状态下表单类型 | string | input/select/date-picker | input | | props | 绑定在表单组件(input/select/date-picker)上的props | object | - | - | | render | 非编辑状态下显示的内容 | function | - | function(h: renderFunction, option: { data: 表单数据对象, value: 当前项的值, i: 当前项的key }) | | editRender | 编辑状态下显示的内容 | function | - | function(h: renderFunction, option: { data: 表单数据对象, value: 当前项的值, i: 当前项的key }) | | options | type为select时的选择项 | array/object | [{ value: any, label: string }, ...]/{ [value]: label, ... } | - | | optionKey | options选项的value与label自定义key与类型 | object | { type: Number / String } | { value: 'value', label: 'label', type: String } | | slot | 使用slot自定义显示内容 | string | - | - |

示例

示例文档