1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-13 23:20:12 +08:00

hide title on form (#493)

This commit is contained in:
elsiosanchez 2020-05-12 03:13:26 -04:00 committed by GitHub
parent c03a3278da
commit cfc03c6c9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,9 +20,9 @@
<el-col :span="24"> <el-col :span="24">
<el-card <el-card
class="content-collapse" class="content-collapse"
:style="isEmptyValue(formMetadata.fieldList) ? 'height: 75vh !important;' : ''" :style="isEmptyValue(formMetadata.fieldList) ? ( showTitle ? 'height: 75vh !important;' : 'height: 78vh !important;') : ''"
> >
<h3 class="warn-content text-center"> <h3 v-if="showTitle" class="warn-content text-center">
<el-popover <el-popover
v-if="!isEmptyValue(formMetadata.help)" v-if="!isEmptyValue(formMetadata.help)"
ref="helpTitle" ref="helpTitle"
@ -40,7 +40,9 @@
> >
{{ formTitle }} {{ formTitle }}
</el-button> </el-button>
<el-button v-if="showTitle" type="text" style="float: right" :circle="true" icon="el-icon-arrow-up" @click="title" />
</h3> </h3>
<el-button v-if="!showTitle" type="text" style="float: right" :circle="true" icon="el-icon-arrow-down" @click="title" />
<form-panel <form-panel
:metadata="{ :metadata="{
...formMetadata, ...formMetadata,
@ -78,6 +80,7 @@ export default {
formUuid: this.$route.meta.uuid, formUuid: this.$route.meta.uuid,
formMetadata: {}, formMetadata: {},
isLoaded: false, isLoaded: false,
showTitle: true,
panelType: 'form' panelType: 'form'
} }
}, },
@ -96,6 +99,9 @@ export default {
this.getForm() this.getForm()
}, },
methods: { methods: {
title() {
this.showTitle = !this.showTitle
},
getForm() { getForm() {
const panel = this.getterForm const panel = this.getterForm
if (panel) { if (panel) {