[element] Solve the problem of page shaking caused by the element bullet box component el-dialog:


1. Question:

insert image description here

2. Solve:
[Method 1] lock-scroll

insert image description here

【Method 2】main.js

insert image description here

ElementUI.Dialog.props.lockScroll.default = false;
[Method 3] Modify the body style:

insert image description here

let mo=function(e){
    
    e.preventDefault();};

stop(){
    
    
	document.body.style.overflow='hidden';
	document.body.style.position='fixed';
	document.body.style.width='100%';
	document.addEventListener("touchmove",mo,false);//禁止页面滑动
},
move(){
    
    
	document.body.style.overflow='';//出现滚动条
	document.body.style.position='initial';
	document.body.style.height='1006px';
	document.removeEventListener("touchmove",mo,false);
},

Guess you like

Origin blog.csdn.net/weixin_53791978/article/details/131354996