Solve the two problems that the vue pop-up window is blocked by the mask layer and the mask layer does not disappear after closing the pop-up window

Problem 1: When the pop-up window is opened, the pop-up window is blocked by the mask layer

insert image description here

Reason: As you can see, the mask layer is overlaid on the APP component. What we need to do is to only target the mask layer on its parent component

insert image description here

Solution: increase :modal-append-to-body='false' this property in the dialog

insert image description here
For details, please refer to the official document of elementui
insert image description here

Question 2: Use the MessageBox pop-up box in the dialog box. After closing, the mask layer does not disappear

insert image description here
insert image description here

Reason: It can be found that the reason is similar to the above, adding the nested pop-up window to the body

insert image description here

Solution: increase append-to-body this property in the dialog

insert image description here
For details, please refer to the official document of elementui
insert image description here

Guess you like

Origin blog.csdn.net/weixin_55966654/article/details/128191380