mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-11-30 22:42:09 +08:00
feat(form): table新增新增按钮配置
This commit is contained in:
parent
e2708b868b
commit
6a7f80c48d
@ -728,6 +728,10 @@ export interface TableConfig extends FormItem {
|
|||||||
rowKey?: string;
|
rowKey?: string;
|
||||||
/** table 新增行时前置回调 */
|
/** table 新增行时前置回调 */
|
||||||
beforeAddRow?: (mForm: FormState | undefined, data: any) => boolean;
|
beforeAddRow?: (mForm: FormState | undefined, data: any) => boolean;
|
||||||
|
addButtonConfig?: {
|
||||||
|
props?: Record<string, any>;
|
||||||
|
text?: string;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GroupListConfig extends FormItem {
|
export interface GroupListConfig extends FormItem {
|
||||||
|
|||||||
@ -60,8 +60,16 @@
|
|||||||
>清空</TMagicButton
|
>清空</TMagicButton
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<TMagicButton v-if="addable" size="small" type="primary" :disabled="disabled" plain @click="newHandler()"
|
<TMagicButton
|
||||||
>新增一行</TMagicButton
|
v-if="addable"
|
||||||
|
class="m-form-table-add-button"
|
||||||
|
size="small"
|
||||||
|
v-bind="config.addButtonConfig?.props || { type: 'primary' }"
|
||||||
|
:disabled="disabled"
|
||||||
|
plain
|
||||||
|
:icon="Plus"
|
||||||
|
@click="newHandler()"
|
||||||
|
>{{ config.addButtonConfig?.text || '新增一行' }}</TMagicButton
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -85,7 +93,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref, useTemplateRef } from 'vue';
|
import { computed, ref, useTemplateRef } from 'vue';
|
||||||
import { FullScreen, Grid } from '@element-plus/icons-vue';
|
import { FullScreen, Grid, Plus } from '@element-plus/icons-vue';
|
||||||
|
|
||||||
import { TMagicButton, TMagicPagination, TMagicTable, TMagicTooltip, TMagicUpload, useZIndex } from '@tmagic/design';
|
import { TMagicButton, TMagicPagination, TMagicTable, TMagicTooltip, TMagicUpload, useZIndex } from '@tmagic/design';
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user