From 587ab3a2720ad75e4b64664f005f72b4e726bca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=96=AA=E5=90=8D?= <942005050@qq.com> Date: Wed, 25 Oct 2023 08:52:23 +0800 Subject: [PATCH] =?UTF-8?q?tableform=E7=BB=84=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TableForm/src/TableForm.vue | 23 +++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/components/TableForm/src/TableForm.vue b/src/components/TableForm/src/TableForm.vue index cb8204696..695b2ea96 100644 --- a/src/components/TableForm/src/TableForm.vue +++ b/src/components/TableForm/src/TableForm.vue @@ -48,11 +48,12 @@ :sortable="headerItem?.tableForm?.sortable || ''" :width="headerItem?.tableForm?.width || '200'" :min-width="headerItem?.tableForm?.minWidth || 'auto'"> - + { return Boolean(colum.tableForm?.disabled) || Boolean(row.disabled) || Boolean(row['disabled_' + colum.field]) } +// const { t } = useI18n() // 国际化 +// const message = useMessage() // 消息弹窗 const TableBaseComponents_Ref = ref() const TableBaseForm_Ref = ref() + /** * 验证表单是否符合rules * @param {*} success 如果验证【成功】走的方法 * @param {*} error 如果验证【不成功】走的方法 */ -const validateForm = async () => { - let _lists = TableBaseForm_Ref.value.map(v => v.validate()) - return Promise.all(_lists).then(res => { +const validateForm = () => { + let _lists = TableBaseForm_Ref.value?.map(v => v.validate()) + return Promise.all(_lists).then(() => { return true - }).catch(err => { + }).catch(() => { return false }) } @@ -389,6 +393,7 @@ const inpuFocus = (headerItem)=>{ emit('inpuFocus') } } + // setup 语法糖 抛出方法 defineExpose({ TableBaseComponents_Ref,