我在 vue 项目中使用 element ui,显示模式/对话框,并在模式中取消订阅输入表单。成功提交后,我会显示一条感谢消息。一切都按预期进行。我唯一的问题是,当显示 v-else(成功消息)时,我想删除注入的 Element UI“X”关闭按钮。这在注入的元素上可能吗?
视图/元素用户界面:
<el-dialog :visible.sync="unsubscribeDialogVisible">
<div class="dialog-content">
<transition name="fadeIn" mode="out-in">
<div v-if="unsubscribeInitialState" key="initial" class="dialog-unsubscibe--initial">
<!-- unsubscribe form -->
<template>
<el-form :model="unsubscribeForm" ref="unsubscribeForm" :rules="unsubscribeRules"
class="unsubscribe-form">
<el-form-item prop="email" class="form-item--text form-item--input">
<el-input placeholder="Email address*" type="email" name="emailUnsubscribe"
id="emailUnsubscribe" v-model="unsubscribeForm.email"></el-input>
</el-form-item>
<button @click.prevent="submitForm('unsubscribeForm')"
class="button button--primary button--submit">
Submit
</button>
</el-form>
</template>
<!-- end: unsubscribe form -->
</div>
<!-- unsubcsribe success -->
<div v-else key="success" class="dialog-unsubscribe--success">
<div class="title">
<h1 class="title-1 font--primary">
<b>You have been successfully unsubscribed</b>
</h1>
</div>
<!-- /.title -->
<button @click="closeSuccessMessage()" class="button--submit">
Close
</button>
</div>
</transition>
</div>
</el-dialog>
不负相思意
相关分类