From 141f3bdbd06f4d32e3d0e871072f876c29a8d68b Mon Sep 17 00:00:00 2001 From: xiaoMingTongXue <40878104+cMing1997@users.noreply.github.com> Date: Tue, 26 Dec 2023 17:56:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E7=9A=84=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E5=A4=96=E9=83=A8=E6=97=A0=E6=B3=95=E4=BF=AE=E6=94=B9=E9=87=8D?= =?UTF-8?q?=E7=BD=AE=E6=88=96=E8=80=85=E6=8F=90=E4=BA=A4=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E7=9A=84=E6=96=87=E5=AD=97=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 解决 eslint-plugin-vue 关于 v-show 无法在 template 中报错的问题 * fix: 修复表单按钮的类型定义外部无法修改重置或者提交按钮的文字的问题 * chore: remove type ButtonOptions --------- Co-authored-by: chengmingrui Co-authored-by: likui628 <90845831+likui628@users.noreply.github.com> --- src/components/Button/src/props.ts | 1 + src/components/Form/src/BasicForm.vue | 4 ---- src/components/Form/src/components/FormAction.vue | 10 ++++------ src/components/Form/src/props.ts | 3 ++- .../SimpleMenu/src/components/SubMenuItem.vue | 3 +-- 5 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/components/Button/src/props.ts b/src/components/Button/src/props.ts index fd5fa52f..a61c6c31 100644 --- a/src/components/Button/src/props.ts +++ b/src/components/Button/src/props.ts @@ -23,4 +23,5 @@ export const buttonProps = { */ iconSize: { type: Number, default: 14 }, onClick: { type: [Function, Array] as PropType<(() => any) | (() => any)[]>, default: null }, + text: { type: String }, }; diff --git a/src/components/Form/src/BasicForm.vue b/src/components/Form/src/BasicForm.vue index 6a56104a..e509b6b2 100644 --- a/src/components/Form/src/BasicForm.vue +++ b/src/components/Form/src/BasicForm.vue @@ -342,10 +342,6 @@ display: flex; } - .ant-form-item-control { - // margin-top: 4px; - } - .suffix { display: inline-flex; align-items: center; diff --git a/src/components/Form/src/components/FormAction.vue b/src/components/Form/src/components/FormAction.vue index cd3700dc..64c6e195 100644 --- a/src/components/Form/src/components/FormAction.vue +++ b/src/components/Form/src/components/FormAction.vue @@ -49,8 +49,6 @@ import { useI18n } from '@/hooks/web/useI18n'; import { propTypes } from '@/utils/propTypes'; - type ButtonOptions = Partial & { text: string }; - defineOptions({ name: 'BasicFormAction' }); const props = defineProps({ @@ -59,11 +57,11 @@ showSubmitButton: propTypes.bool.def(true), showAdvancedButton: propTypes.bool.def(true), resetButtonOptions: { - type: Object as PropType, + type: Object as PropType, default: () => ({}), }, submitButtonOptions: { - type: Object as PropType, + type: Object as PropType, default: () => ({}), }, actionColOptions: { @@ -93,7 +91,7 @@ return actionColOpt; }); - const getResetBtnOptions = computed((): ButtonOptions => { + const getResetBtnOptions = computed((): ButtonProps => { return Object.assign( { text: t('common.resetText'), @@ -102,7 +100,7 @@ ); }); - const getSubmitBtnOptions = computed(() => { + const getSubmitBtnOptions = computed((): ButtonProps => { return Object.assign( { text: t('common.queryText'), diff --git a/src/components/Form/src/props.ts b/src/components/Form/src/props.ts index fb96e471..91c69f9c 100644 --- a/src/components/Form/src/props.ts +++ b/src/components/Form/src/props.ts @@ -2,10 +2,11 @@ import type { FieldMapToTime, FormSchema } from './types/form'; import type { CSSProperties, PropType } from 'vue'; import type { ColEx } from './types'; import type { TableActionType } from '@/components/Table'; -import type { ButtonProps } from 'ant-design-vue/es/button/buttonTypes'; import type { RowProps } from 'ant-design-vue/lib/grid/Row'; import { propTypes } from '@/utils/propTypes'; +import { ButtonProps } from '@/components/Button'; + export const basicProps = { model: { type: Object as PropType, diff --git a/src/components/SimpleMenu/src/components/SubMenuItem.vue b/src/components/SimpleMenu/src/components/SubMenuItem.vue index 9c4a8c6b..b21e2d65 100644 --- a/src/components/SimpleMenu/src/components/SubMenuItem.vue +++ b/src/components/SimpleMenu/src/components/SubMenuItem.vue @@ -44,8 +44,7 @@ :class="`${prefixCls}-submenu-title-icon`" /> - -