Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iview4.0使用modal框问题记录 #13

Open
Diazhao opened this issue May 21, 2020 · 0 comments
Open

iview4.0使用modal框问题记录 #13

Diazhao opened this issue May 21, 2020 · 0 comments

Comments

@Diazhao
Copy link
Owner

Diazhao commented May 21, 2020

  1. 用一个单独的组件直接嵌套Modal框的时候,如果在外部使用v-if控制组件的显隐,会有Modal框关不掉的问题。
    初步排查是通过v-if控制的话,因为组件的表现状态是Modal框。Modal框的显隐是通过v-model来控制的,v-model的值并没有变化,最终导致Modal框不会关闭。
    解决方案是在Modal外部加一层div,组件的形态就变成了div中嵌套的modal,这样可以v-if就可以拿到对组件的控制权,而不是Modal的v-model。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant