Skip to content

Commit

Permalink
fix: 修复一些小bug
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaofan9 committed Apr 7, 2021
1 parent b843c38 commit 5e3d973
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "v-form-engine",
"version": "1.1.6",
"version": "1.1.7",
"description": "一个基于 vue + element-ui 的 PC 端表单引擎。支持灵活的配置项、编辑/查看两种视图、自定义模板/插槽、溢出隐藏、双击复制等...",
"typings": "dist/index.d.ts",
"main": "dist/v-form-engine.js",
Expand Down
7 changes: 6 additions & 1 deletion src/form-engine.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export type Item = {
prop: string;
formSlot: boolean;
required: boolean;
requiredErrMsg: string;
slot: boolean;
rules: Rule | Rule[];
label: string;
Expand Down Expand Up @@ -350,13 +351,17 @@ export default class FormEngine extends Vue {
let message = '';
let trigger = 'blur';
if (/(input|select|autocomplete)$/.test(tmpItem.type) || !tmpItem.type) {
if (/(input|autocomplete|input-number)$/.test(tmpItem.type) || !tmpItem.type) {
message = `请输入${tmpItem.label}`;
} else if (tmpItem.type !== 'button' && tmpItem.type !== 'text') {
message = `请选择${tmpItem.label}`;
trigger = 'change';
}
if (tmpItem.requiredErrMsg) {
message = tmpItem.requiredErrMsg;
}
if (tmpItem.type === 'autocomplete') {
trigger = 'change';
}
Expand Down

0 comments on commit 5e3d973

Please sign in to comment.