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

基础使用

注意:第二次打不开,需要手动添加事件(@closeDialog="state.passDialogVisible = false")

当关闭弹框,需要清空Form表单值时,绑定ref,调用组件内部的回调方法resetModelForm即可清空

<template>
  <div>
    <Dialog
      :dialogVisible="state.dialogVisible"
      title="对话框"
      width="500"
      @close="closeDialog"
    >
      <Form
        ref="refForm"
        :labelWidth="80"
        :formColumns="state.formColumns"
        :inline="false"
      />
    </Dialog>
    <el-button @click="state.dialogVisible = true">打开对话框</el-button>
  </div>
</template>

<script setup>
import { Dialog, Form } from "../../../src/dist/index";
import { reactive, ref } from "vue";

const refForm = ref(null);

const state = reactive({
  dialogVisible: false,
  formColumns: [
    {
      prop: "name",
      label: "昵称",
      filterType: "input",
      rules: {
        required: true,
        message: "昵称不能为空",
        trigger: "blur",
      },
    },
    {
      prop: "state",
      label: "状态",
      filterType: "select",
      defaultVal: 0,
      width: "140",
      option: [
        { label: "全部", value: 0 },
        { label: "通过", value: 1 },
      ],
    },
    {
      filterType: "btn",
      btnArr: [
        { btnId: 0, label: "取消", color: "primary" },
        { btnId: 1, label: "确定", color: "success" },
      ],
    },
  ],
});

const closeDialog = () => {
  state.dialogVisible = false
  if (refForm.value) {
    refForm.value.resetModelForm();
  }
};
</script>


事件

属性名说明出参
onCloseDialogDialog 关闭的回调

属性

属性名说明默认值类型
dialogVisible是否显示对话框falseboolean
titletitlestring
widthwidthnumber
Last Updated:
Contributors: const
Prev
Pageinate
Next
Descriptions