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>
This commit is contained in:
xiaoMingTongXue
2023-12-26 17:56:13 +08:00
committed by GitHub
parent cc97f06354
commit 141f3bdbd0
5 changed files with 8 additions and 13 deletions

View File

@@ -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 },
};

View File

@@ -342,10 +342,6 @@
display: flex;
}
.ant-form-item-control {
// margin-top: 4px;
}
.suffix {
display: inline-flex;
align-items: center;

View File

@@ -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'),

View File

@@ -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>,

View File

@@ -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>