el-table-jsx文档el-table-jsx文档
指南
组件
github
npm
指南
组件
github
npm
  • MTable
  • Table
  • Form
  • Pageinate
  • Dialog
  • Descriptions
  • Tooltip
  • Tooltip
  • formColumns 属性
  • columns 属性

基础使用

Date
To
昵称
状态
<template>
    <Form
      :formColumns="formColumns"
    />
  </template>
  
  <script setup>
  import { Form } from "el-table-jsx";
  
  const formColumns = [
    {
      prop: "date",
      label: "Date",
      filterType: "date",
    },
    {
      prop: "name",
      label: "昵称",
      filterType: "input",
    },
    {
      prop: "state",
      label: "状态",
      filterType: "select",
      defaultVal: 0,
      width: "140",
      option: [
        { label: "全部", value: 0 },
        { label: "通过", value: 1 },
        { label: "取消", value: 2 },
        { label: "禁用", value: 3 },
      ],
    },
    {
      filterType: "btn",
      btnArr: [
        { btnId: 0, label: "查询", color: "primary" },
        { btnId: 1, label: "新增", color: "success" },
        { btnId: 2, label: "重置", color: "warning", disabled: true },
      ],
    },
  ];
  </script>
  

事件

事件名说明出参
onFormEventForm 表单事件e: {form, btnInfo}
onResetSearch重置搜索Formb 表单默认值
onRadioChange单选框sour, e
onCheckboxChange多选框sour, e
onInputChange单选框sour, e
inputBtnSearchinput 右边插槽按钮事件sour, val, modelForm
imgSuccess文件上传成功时的钩子接口返回的值(res), sour
imgRemove文件列表移除文件时的钩子uploadFile, uploadFiles, sour
imgPreview文件列表移除文件时的钩子uploadFile
beforeUpload上传文件之前的钩子,参数为上传的文件, 若返回false或者返回 Promise 且被 reject,则停止上传。rawFile, sour
inputBtnSearchinput 右边插槽按钮事件
resetModelForm使用 ref 来调用子组件的 resetModelForm 方法FormRef.value.resetModelForm(),以达到清空数据的效果

属性

属性名说明默认值类型
formColumnsformColumns
inline行内表单模式trueboolean
labelWidth标签的长度,例如 '50'。 作为 Form 直接子元素的 form-item 会继承该值。 可以使用 autonumber
labelPosition表单域标签的位置, 当设置为 left 或 right 时,则也需要设置 label-width 属性rightstring
shortcuts设置快捷选项,需要传入数组对象不传默认展示 last week, last month, last 3 monthobject
multiplefilterType为 select 设置 multiple 属性即可启用多选falseboolean
Last Updated:
Contributors: const
Prev
Table
Next
Pageinate