From c7856712fe8b952946859ef9f461b292e694f739 Mon Sep 17 00:00:00 2001 From: "X.Mo" Date: Wed, 30 Oct 2024 22:07:44 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20ma-form=20=E5=92=8C=20ma-search?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/demos/ma-form/config/index.vue | 80 +++++++++++++++++++++++-- docs/demos/ma-form/getRef/index.vue | 45 ++++++++++++++ docs/demos/ma-form/template/index.vue | 60 +++++++++++++++++++ docs/demos/ma-search/index.vue | 2 +- docs/zh/front/component/ma-form.md | 9 ++- docs/zh/front/component/ma-search.md | 86 +++++++++++++++++++++++++++ package.json | 4 +- pnpm-lock.yaml | 20 +++---- 8 files changed, 286 insertions(+), 20 deletions(-) create mode 100644 docs/demos/ma-form/getRef/index.vue create mode 100644 docs/demos/ma-form/template/index.vue diff --git a/docs/demos/ma-form/config/index.vue b/docs/demos/ma-form/config/index.vue index 96c0baf..6b9ca54 100644 --- a/docs/demos/ma-form/config/index.vue +++ b/docs/demos/ma-form/config/index.vue @@ -1,11 +1,79 @@ - +const model = ref({ + name: '萧晨', + age: 22, + sex: 1, + hobby: '4', - +const hobby = reactive([ + { label: '唱', value: '1' }, + { label: '跳', value: '2' }, + { label: 'Rap', value: '3' }, + { label: '篮球', value: '4' }, + { label: '足球', value: '5' }, + { label: '羽毛球', value: '6' }, +]) - \ No newline at end of file +const options = ref({ + footerSlot: () => ( +
+ { + formRef.value.setLoadingState(true) + setTimeout(() => { + formRef.value.getElFormRef().validate().then(() => { + ElMessage.success('验证通过') + formRef.value.setLoadingState(false) + }).catch(() => { + ElMessage.error('验证失败') + formRef.value.setLoadingState(false) + }) + }, 1000) + }}>提交 +
+ ) +}) + + + diff --git a/docs/demos/ma-form/getRef/index.vue b/docs/demos/ma-form/getRef/index.vue new file mode 100644 index 0000000..400ed5d --- /dev/null +++ b/docs/demos/ma-form/getRef/index.vue @@ -0,0 +1,45 @@ + + + diff --git a/docs/demos/ma-form/template/index.vue b/docs/demos/ma-form/template/index.vue new file mode 100644 index 0000000..7c4e1d8 --- /dev/null +++ b/docs/demos/ma-form/template/index.vue @@ -0,0 +1,60 @@ + + + diff --git a/docs/demos/ma-search/index.vue b/docs/demos/ma-search/index.vue index 96c0baf..99c8a4e 100644 --- a/docs/demos/ma-search/index.vue +++ b/docs/demos/ma-search/index.vue @@ -3,7 +3,7 @@