mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
chore(form): form-dialog放到body下
This commit is contained in:
parent
3b4a57fa94
commit
39cd7d8ab7
@ -1,52 +1,52 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
class="m-form-dialog"
|
||||
top="20px"
|
||||
:title="title"
|
||||
:appendToBody="true"
|
||||
:width="width"
|
||||
:fullscreen="fullscreen"
|
||||
:close-on-click-modal="false"
|
||||
@close="closeHandler"
|
||||
>
|
||||
<div class="m-dialog-body" :style="`max-height: ${bodyHeight}; overflow-y: auto; overflow-x: hidden;`">
|
||||
<m-form
|
||||
v-model="stepActive"
|
||||
ref="form"
|
||||
:size="size"
|
||||
:config="config"
|
||||
:init-values="values"
|
||||
:label-width="labelWidth"
|
||||
@change="changeHandler"
|
||||
></m-form>
|
||||
<slot></slot>
|
||||
</div>
|
||||
<teleport to="body">
|
||||
<div class="m-form-dialog" v-show="dialogVisible">
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
top="20px"
|
||||
:title="title"
|
||||
:width="width"
|
||||
:fullscreen="fullscreen"
|
||||
:close-on-click-modal="false"
|
||||
@close="closeHandler"
|
||||
>
|
||||
<div class="m-dialog-body" :style="`max-height: ${bodyHeight}; overflow-y: auto; overflow-x: hidden;`">
|
||||
<m-form
|
||||
v-model="stepActive"
|
||||
ref="form"
|
||||
:size="size"
|
||||
:config="config"
|
||||
:init-values="values"
|
||||
:label-width="labelWidth"
|
||||
@change="changeHandler"
|
||||
></m-form>
|
||||
<slot></slot>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<el-row class="dialog-footer">
|
||||
<el-col :span="12" style="text-align: left">
|
||||
<div style="min-height: 1px">
|
||||
<slot name="left"></slot>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<slot name="footer">
|
||||
<el-button @click="cancel" size="small">取 消</el-button>
|
||||
<el-button v-if="hasStep && stepActive > 1" type="info" size="small" @click="preStep">上一步</el-button>
|
||||
<el-button v-if="hasStep && stepCount > stepActive" type="info" size="small" @click="nextStep"
|
||||
>下一步</el-button
|
||||
>
|
||||
<el-button v-else type="primary" size="small" :loading="saveFetch" @click="save">{{
|
||||
confirmText
|
||||
}}</el-button>
|
||||
</slot>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-row class="dialog-footer">
|
||||
<el-col :span="12" style="text-align: left">
|
||||
<div style="min-height: 1px">
|
||||
<slot name="left"></slot>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<slot name="footer">
|
||||
<el-button @click="cancel" size="small">取 消</el-button>
|
||||
<el-button v-if="hasStep && stepActive > 1" type="info" size="small" @click="preStep">上一步</el-button>
|
||||
<el-button v-if="hasStep && stepCount > stepActive" type="info" size="small" @click="nextStep"
|
||||
>下一步</el-button
|
||||
>
|
||||
<el-button v-else type="primary" size="small" :loading="saveFetch" @click="save">{{
|
||||
confirmText
|
||||
}}</el-button>
|
||||
</slot>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</teleport>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
|
@ -97,7 +97,7 @@ export interface ContainerCommonConfig {
|
||||
export interface Rule {
|
||||
message?: string;
|
||||
/** 系统提供的验证器类型。有:string,number,boolean,method,regexp,integer,float,array,object,enum,date,url,hex,email,any */
|
||||
type: string;
|
||||
type?: string;
|
||||
/** 是否必填 */
|
||||
required?: boolean;
|
||||
/** 自定义验证器 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user