WebApp【公共组件库】@前端(For Git Submodule)
Tevin
2021-03-17 54f1f35024c29f1cadc77d17ad7d5e66e644fb23
forms/form/CFormItem.vue
@@ -36,7 +36,7 @@
                label: this.label,
                required: this.isRequired,
                error: this.error,
                onChange: (evt) => this.onChange(evt),
                onChange: evt => this.onChange(evt),
            };
        },
        isRequired() {
@@ -66,8 +66,9 @@
                    !hasOwn.call(evt, 'constructor') &&
                    !hasOwn.call(evt.constructor.prototype, 'isPrototypeOf')
                ) {
                    throw new Error('错误的表单项 onChange 参数类型!(At: ' + this.name + ')');
                    return;
                    throw new Error(
                        '错误的表单项 onChange 参数类型!(At: ' + this.name + ')'
                    );
                }
            }
            // 未改变值不触发
@@ -83,7 +84,7 @@
        this.$nextTick(() => {
            // 未设置验证
            if (!this.required && !this.rules) {
                this.formRes.$regItemValidator(this.name, (validateType) => {
                this.formRes.$regItemValidator(this.name, validateType => {
                    this.error = false;
                    return Promise.resolve({
                        name: this.name,
@@ -105,13 +106,13 @@
                validator.messages(validateMsgs);
                // 注册验证
                let errTimer = null;
                this.formRes.$regItemValidator(this.name, (validateType) => {
                this.formRes.$regItemValidator(this.name, validateType => {
                    return validator
                        .validate({
                            [this.name]: this.formRes.formData[this.name],
                        })
                        .then(
                            (res) => {
                            res => {
                                this.error = false;
                                return {
                                    name: this.name,