亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在 vue / element ui 對話框中有條件地刪除注入的元素

在 vue / element ui 對話框中有條件地刪除注入的元素

臨摹微笑 2023-07-06 09:53:05
我在 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>
查看完整描述

1 回答

?
不負相思意

TA貢獻1777條經驗 獲得超10個贊

文檔說有一個prop 你可以傳遞給,所以嘗試傳遞相同的 v-if/else 條件給它show-closeel-dialog

<el-dialog :visible.sync="unsubscribeDialogVisible" :show-close="unsubscribeInitialState">


查看完整回答
反對 回復 2023-07-06
  • 1 回答
  • 0 關注
  • 186 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號