表单校验几个细节问题

This commit is contained in:
Chopper
2021-10-19 14:20:20 +08:00
parent 7cbd2b698c
commit 31d9859f10
6 changed files with 42 additions and 23 deletions

View File

@@ -35,7 +35,7 @@
:width="500"
>
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
<FormItem label="自定义分词" prop="sn">
<FormItem label="自定义分词" prop="name">
<Input v-model="form.name" clearable style="width: 100%" />
</FormItem>
</Form>
@@ -56,6 +56,8 @@ import {
insertCustomWords,
updateCustomWords
} from "@/api/index";
import { regular } from "@/utils";
export default {
name: "customWords",
data() {
@@ -79,11 +81,8 @@ export default {
// 表单验证规则
formValidate: {
name: [
{
required: true,
message: "请输入自定义分词",
trigger: "blur",
},
regular.REQUIRED,
regular.VARCHAR20
],
},
submitLoading: false, // 添加或编辑提交状态