iview在模态框中点击标签打开另一个模态框时,原模态框不关闭

题目描述

clipboard.png

点击"已有账号 立即登录",出现如下效果

clipboard.png

原来的注册框没有被关闭

题目来源及自己的思路

项目中遇到的问题,看了官方文档还是不太清楚

相关代码

// 请把代码文本粘贴到下方(请勿用图片代替代码)
<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位,至少包含字母、数字和符号中的两种类型,切不可与账号相同</span><br>
                                <Checkbox v-model="single" style="margin-top:10px;">同意<a href="">《服务协议》</a>和<a href="">《隐私条款》</a></Checkbox><br>
                                <Button type="primary" style="margin:10px;">注册账号</Button><br>
                                <a @click="modal4 = true" style="cursor:pointer">已有账号 立即登录</a>
                            </Modal>

你期待的结果是什么?实际看到的错误信息又是什么?

希望弹出新的对话框的同时关闭原来的对话框

阅读 3.3k
1 个回答

控制会员注册的显示隐藏的变量是modal2
当你点击 已有账号 立即登录 时
把modal2设为false

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题