鍍金池/ 問答/HTML/ iview在模態(tài)框中點擊標(biāo)簽打開另一個模態(tài)框時,原模態(tài)框不關(guān)閉

iview在模態(tài)框中點擊標(biāo)簽打開另一個模態(tài)框時,原模態(tài)框不關(guān)閉

題目描述

clipboard.png

點擊"已有賬號 立即登錄",出現(xiàn)如下效果

clipboard.png

原來的注冊框沒有被關(guān)閉

題目來源及自己的思路

項目中遇到的問題,看了官方文檔還是不太清楚

相關(guān)代碼

// 請把代碼文本粘貼到下方(請勿用圖片代替代碼)
<Modal

                                v-model="modal1"
                                title="會員登錄">
                                <Input v-model="value" placeholder="請輸入郵箱賬號" style="width: 300px;margin-bottom:10px;"></Input>
                                <Input v-model="value" type="password" placeholder="請輸入密碼" style="width: 300px;margin-bottom:10px;"></Input>
                                <Button type="primary" style="margin-bottom:10px;">立即登錄</Button>
                                <div style="text-align:right;">
                                    <a @click="modal3 = true" style="cursor:pointer">忘記密碼</a>
                                    <span style="display:inline-block;width:20px;"></span>
                                    <a @click="modal2 = true" style="cursor:pointer">注冊賬號</a>
                                </div>
                            </Modal>
                            <Modal
                                v-model="modal2"
                                title="會員注冊">
                                <Input v-model="value" placeholder="請輸入郵箱賬號" style="width: 300px;margin-bottom:10px;"></Input>
                                <span>這是您的賬號</span>
                                <Input v-model="value" type="password" placeholder="請輸入密碼" style="width: 300px;margin-bottom:10px;"></Input>
                                <Input v-model="value" type="password" placeholder="請再次輸入密碼" style="width: 300px"></Input>
                                <span>密碼長度為8-16位,至少包含字母、數(shù)字和符號中的兩種類型,切不可與賬號相同</span><br>
                                <Checkbox v-model="single" style="margin-top:10px;">同意<a href="">《服務(wù)協(xié)議》</a>和<a href="">《隱私條款》</a></Checkbox><br>
                                <Button type="primary" style="margin:10px;">注冊賬號</Button><br>
                                <a @click="modal4 = true" style="cursor:pointer">已有賬號 立即登錄</a>
                            </Modal>

你期待的結(jié)果是什么?實際看到的錯誤信息又是什么?

希望彈出新的對話框的同時關(guān)閉原來的對話框

回答
編輯回答
不歸路

控制會員注冊的顯示隱藏的變量是modal2
當(dāng)你點擊 已有賬號 立即登錄 時
把modal2設(shè)為false

2018年4月7日 08:35