Browse Source
fix: 修复表单按钮的类型定义外部无法修改重置或者提交按钮的文字的问题
* 解决 eslint-plugin-vue 关于 v-show 无法在 template 中报错的问题
* fix: 修复表单按钮的类型定义外部无法修改重置或者提交按钮的文字的问题
* chore: remove type ButtonOptions
---------
Co-authored-by: chengmingrui <chengmingrui@oneaiops.com>
Co-authored-by: likui628 <90845831+likui628@users.noreply.github.com>
pull/3471/head
xiaoMingTongXue
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with
8 additions and
13 deletions
-
src/components/Button/src/props.ts
-
src/components/Form/src/BasicForm.vue
-
src/components/Form/src/components/FormAction.vue
-
src/components/Form/src/props.ts
-
src/components/SimpleMenu/src/components/SubMenuItem.vue
|
|
|
@ -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 }, |
|
|
|
}; |
|
|
|
|
|
|
|
@ -342,10 +342,6 @@ |
|
|
|
display: flex; |
|
|
|
} |
|
|
|
|
|
|
|
.ant-form-item-control { |
|
|
|
// margin-top: 4px; |
|
|
|
} |
|
|
|
|
|
|
|
.suffix { |
|
|
|
display: inline-flex; |
|
|
|
align-items: center; |
|
|
|
|
|
|
|
@ -49,8 +49,6 @@ |
|
|
|
import { useI18n } from '@/hooks/web/useI18n'; |
|
|
|
import { propTypes } from '@/utils/propTypes'; |
|
|
|
|
|
|
|
type ButtonOptions = Partial<ButtonProps> & { 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<ButtonOptions>, |
|
|
|
type: Object as PropType<ButtonProps>, |
|
|
|
default: () => ({}), |
|
|
|
}, |
|
|
|
submitButtonOptions: { |
|
|
|
type: Object as PropType<ButtonOptions>, |
|
|
|
type: Object as PropType<ButtonProps>, |
|
|
|
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'), |
|
|
|
|
|
|
|
@ -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<Recordable>, |
|
|
|
|
|
|
|
@ -44,8 +44,7 @@ |
|
|
|
:class="`${prefixCls}-submenu-title-icon`" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<!-- eslint-disable-next-line --> |
|
|
|
<template #content v-show="state.opened"> |
|
|
|
<template #content v-if="state.opened"> |
|
|
|
<div v-bind="getEvents(true)"> |
|
|
|
<ul :class="[prefixCls, `${prefixCls}-${getTheme}`, `${prefixCls}-popup`]"> |
|
|
|
<slot></slot> |
|
|
|
|