New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

table-form-item

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

table-form-item

table-form-item 解决el-table无法校验表单问题

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

table-form-item

适用于 vue项目中使用 element-ui组件库的项目,用于解决el-table中的表单校验的痛点,也可以在任何其他组件中使用。

Install

npm install table-form-item

Usage

全局注册组件

import TableFormItem from "table-form-item";

Vue.use(TableFormItem);

或者局部组件中引用:

import { tableFormItem as TableFormItem } from "table-form-item";

export default {
  components: {
    TableFormItem
  },
};

然后再模板(template)中使用:

<template>
  <TableFormItem :row="form" prop="name" required="true" label="名称">
    //插槽内容
    <el-input type="input" v-model="form.name" />
  </TableFormItem>
</template>
export default {
  data () {
    return {
      form: { 
         value: '' 
      }
    }
  }
}

Api文档

属性描述类型必传默认值
row需要校验的对象objectYnull
required校验必填booleanNfalse
prop属性值stringY-
labelrequired校验未通过时会用到,不传的话使用的是propstringN-
rules校验规则与el-form中rules一致array[object]N-
default默认插槽,插槽内容可以是表单元素,默认值是---Y-

License

MIT ©

FAQs

Package last updated on 24 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts