hookehuyr

✨ feat: 完善错误滚动功能

<!--
* @Date: 2022-08-30 11:34:19
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-04-04 15:11:55
* @LastEditTime: 2023-04-04 15:50:47
* @FilePath: /custom_form/src/components/CheckboxField/index.vue
* @Description: 多项选择控件
-->
......@@ -120,7 +120,7 @@ const validCheckbox = () => {
// 必填项
props.item.component_props.options.some(item => {
// 必选项勾选校验
if (!checkbox_value.value.length && item.input_required) {
if (props.item.component_props.required && !checkbox_value.value.length) {
show_error.value = true;
error_msg.value = '必填项不能为空';
return true;
......
......@@ -136,8 +136,8 @@ const showUrl = (rule) => { // 跳转设置链接
// 小程序需要配置制定域名内网页,功能无法实现。
}
const rule_content = ref("");
const show_error = ref(false);
// 校验模块
const validRadio = () => {
// 必填项
......
<!--
* @Date: 2023-03-24 09:19:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-04-04 15:38:07
* @LastEditTime: 2023-04-04 15:54:24
* @FilePath: /custom_form/src/pages/table/index.vue
* @Description: 文件描述
-->
......@@ -437,7 +437,7 @@ const validOther = () => {
valid = {
status: input.value[index].validInput(),
key: "input",
id: multi_rule.value[index].id
id: input.value[index]?.id
};
return false;
}
......@@ -450,7 +450,7 @@ const validOther = () => {
valid = {
status: textarea.value[index].validTextarea(),
key: "textarea",
id: multi_rule.value[index].id
id: textarea.value[index]?.id
};
return false;
}
......@@ -463,7 +463,7 @@ const validOther = () => {
valid = {
status: radio.value[index].validRadio(),
key: "radio",
id: multi_rule.value[index].id
id: radio.value[index]?.id
};
return false;
}
......@@ -476,7 +476,7 @@ const validOther = () => {
valid = {
status: checkbox.value[index].validCheckbox(),
key: "checkbox",
id: multi_rule.value[index].id
id: checkbox.value[index]?.id
};
return false;
}
......@@ -489,7 +489,7 @@ const validOther = () => {
valid = {
status: multi_rule.value[index].validMultiRule(),
key: "multi_rule",
id: multi_rule.value[index].id
id: multi_rule.value[index]?.id
};
return false;
}
......