lh-work-ui
v1.0.1
Published
狂拽炫酷无敌暴龙战士UI
Downloads
4
Readme
介绍
狂拽炫酷无敌暴龙战士UI
安装
npm i lh-work-ui
使用
import { DynamicFormVue, FormTypeEnums, ElementType } from "lh-work-ui";
import "lh-work-ui/style.css";
/** @state */
const columns = ref<ElementType[]>([
{
title: "姓名",
elementType: FormTypeEnums.TEXT,
index: "name",
value: "",
required: true,
rules: [{ required: true, message: "请填写姓名" }],
},
{
title: "城市",
elementType: FormTypeEnums.SELECT,
index: "city",
value: "3",
required: true,
rules: [{ required: true, message: "请选择城市" }],
valueEnums: [
{ text: "泸州", value: "1" },
{ text: "成都", value: "2" },
{ text: "重庆", value: "3" },
],
ext: {},
}
]);
/** @method */
const handleSubmit = (data: any, ext: any) => {
console.log("表单数据", data);
console.log("扩展数据", ext);
}
</script>
<template>
<!-- 动态表单组件 -->
<DynamicFormVue :columns="columns" @handle-submit="handleSubmit" />
</template>