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

hatech-web-component-form

v1.2.0

Published

表单组件,提供快速展示表单功能

Downloads

2

Readme

前端表单组件

提供通过配置快速展示Form表单,支持Element-UI中常用元素,如Input\Select\Radio等

主要思路是依托于ElementUI的Form通过类型映射,展示表单项。


使用说明

安装

  npm install hatech-web-component-form

初始化

  // main.js
  import Vue from 'vue'
  import HatechForm from 'hatech-web-component-form'
  Vue.use(HatechTable)
  // or
  import { HatechForm } from 'hatech-web-component-form'
  export default {
    components: {
      HatechForm
    }
  }

使用示例

  <hatech-form :config="config" :data="data" @onEvent="onEvent"></hatech-form>
  export default {
    data() {
      return {
        data: {
          ...
        },
        config: {
          ...
        }
      }
    }
  }

参数

| 参数名 | 类型 | 描述 | | ---------------------------- | ---------------- | ------------------------------------------------ | | data | Object | 数据源 | | config | Object | 配置 | | config.form | Object | 表单配置项,支持el-form所有属性 | | config.row | Object | 栅格布局参数,支持el-row所有属性 | | config.columns | Array | 表单项配,支持el-form-item中的所有属性置 | | config.columns[].type | String | 表单项类型,详见下表表单项配置类型 | | config.columns[].{MODE}Type | String | 模式对应表单项类型 | | config.columns[].show | Boolean\Function | 是否展示表单项,如果值为函数,需要返回Boolean值 | | config.columns[].col | Object | 栅格布局参数,支持el-col所有属性 | | config.columns[].props | String | 具体展示组件属性,详细可见element-ui组件文档 | | config.columns[].{MODE}Props | Object | 对应模式配置 | | config.columns[].props.event | String | 相关事件名 |

表单项配置类型

| 类型值 | 类型名称 | 说明 | | ------------------------------ | -------------- | ---------------------------------------------------------------------------------------------- | | slot | 插槽 | 插槽名同prop属性 | | text | 文本、html显示 | 通过props内设置type='html'展示html | | | | 当type=html时,可使用key对应元素属性,event对应抛出事件名 | | input | 输入框 | 同el-input。添加modifier属性,支持修饰符值 | | number | 数字输入框 | 同el-input-number | | radio | 单选框 | 同el-radio | | checkbox | 多选框 | 同el-checkbox | | select | 下拉框 | 同el-select | | date | 日期选择框 | 同el-date-picker | | time | 时间选择框 | 同el-time-picker | | cascader | 级联 | 同el-cascader | | switch | 开关 | 同el-switch | | slider | 滑块 | 同el-slider | | rate | 评分 | 同el-rate | | transfer | 穿梭框 | 同el-transfer | | progress | 进度条 | 同el-progress | | tree | 树形控件 | 同el-tree,触发的事件由onFormTreeEvent传出 | | table | 表格控件 | 同hatech-table触发的事件由onFormTableEvent传出 | | button | 按钮控件 | options 同el-button | | custom(自定义组件后半段名称) | 自定义组件 | 以Form开头,比如FormCustomerComponent,且此组件需要全局注册;但type中只要写CustomerComponent; |


插槽

当type为slot时,提供同prop值一样的插槽

...

事件

onEvent: 事件总处理,所有事件都由此事件发射

  • event: {String} 子事件名
  • params: {Object} 事件相关参数

onFormDataChange: 表单数据变化

  • newValue: 新值
  • oldValue: 旧值
  • item: 表单项配置

onFormTreeEvent: 树相关事件传递

  • event: 事件名
  • params: 事件参数

onFormTableEvent: 表格相关事件传递

  • event: 事件名
  • params: 事件参数

onFormButtonEvent: 按钮点击相关事件

  • params: 按钮配置

主题变量

未使用主题变量

依赖

| 依赖名 | 版本 | 链接 | | -------------------- | ----- | -------------------------------------------------------------------------- | | hatech-web-component | 0.0.8 | http://git.hatech.com.cn:8088/hatech-web/hatech-web-template-component.git |


知识点?

使用共识?

如已提供相关表单项,可直接使用。有个性化需要,请通过slot实现


特点?

该组件属性纯组件中的表单组件,属于基础组件


作者/维护者

| 名称 | 联系方式 | 参与部分 | | ---- | --------------------- | ------------ | | 吴浩 | [email protected] | 初始版本开发 |