✨(component): layer 新增 full\min\restore 三种回调事件
#I5C2OK
This commit is contained in:
		
							parent
							
								
									21835edb61
								
							
						
					
					
						commit
						36b6c31824
					
				@ -191,7 +191,10 @@ const openMaxmin = function() {
 | 
				
			|||||||
        type: 1,
 | 
					        type: 1,
 | 
				
			||||||
        title: "标题",
 | 
					        title: "标题",
 | 
				
			||||||
        maxmin: true,
 | 
					        maxmin: true,
 | 
				
			||||||
        content: "内容"
 | 
					        content: "内容",
 | 
				
			||||||
 | 
					        full:(e)=>{console.log('full',e)},
 | 
				
			||||||
 | 
					        min:(e)=>{console.log('min',e)},
 | 
				
			||||||
 | 
					        restore:(e)=>{console.log('restore',e)}
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -90,6 +90,9 @@ export interface LayModalProps {
 | 
				
			|||||||
  appContext?: any;
 | 
					  appContext?: any;
 | 
				
			||||||
  startIndex?: number;
 | 
					  startIndex?: number;
 | 
				
			||||||
  imgList?: { src: string; alt: string }[];
 | 
					  imgList?: { src: string; alt: string }[];
 | 
				
			||||||
 | 
					  min?: Function;
 | 
				
			||||||
 | 
					  full?: Function;
 | 
				
			||||||
 | 
					  restore?: Function;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const props = withDefaults(defineProps<LayModalProps>(), {
 | 
					const props = withDefaults(defineProps<LayModalProps>(), {
 | 
				
			||||||
@ -115,6 +118,9 @@ const props = withDefaults(defineProps<LayModalProps>(), {
 | 
				
			|||||||
  destroy: () => { },
 | 
					  destroy: () => { },
 | 
				
			||||||
  success: () => { },
 | 
					  success: () => { },
 | 
				
			||||||
  end: () => { },
 | 
					  end: () => { },
 | 
				
			||||||
 | 
					  full: () => { },
 | 
				
			||||||
 | 
					  min: () => { },
 | 
				
			||||||
 | 
					  restore: () => { },
 | 
				
			||||||
  yesText: "确定",
 | 
					  yesText: "确定",
 | 
				
			||||||
  isFunction: false,
 | 
					  isFunction: false,
 | 
				
			||||||
  isMessage: false,
 | 
					  isMessage: false,
 | 
				
			||||||
@ -224,6 +230,7 @@ const maxHandle = () => {
 | 
				
			|||||||
    h.value = _h.value;
 | 
					    h.value = _h.value;
 | 
				
			||||||
    t.value = _t.value;
 | 
					    t.value = _t.value;
 | 
				
			||||||
    l.value = _l.value;
 | 
					    l.value = _l.value;
 | 
				
			||||||
 | 
					    props.restore(props.id)
 | 
				
			||||||
  } else {
 | 
					  } else {
 | 
				
			||||||
    _t.value = t.value;
 | 
					    _t.value = t.value;
 | 
				
			||||||
    _l.value = l.value;
 | 
					    _l.value = l.value;
 | 
				
			||||||
@ -233,6 +240,7 @@ const maxHandle = () => {
 | 
				
			|||||||
    h.value = maxArea().h;
 | 
					    h.value = maxArea().h;
 | 
				
			||||||
    t.value = maxOffset().t;
 | 
					    t.value = maxOffset().t;
 | 
				
			||||||
    l.value = maxOffset().l;
 | 
					    l.value = maxOffset().l;
 | 
				
			||||||
 | 
					    props.full(props.id)
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  max.value = !max.value;
 | 
					  max.value = !max.value;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
@ -251,6 +259,7 @@ const minHandle = () => {
 | 
				
			|||||||
    h.value = _h.value;
 | 
					    h.value = _h.value;
 | 
				
			||||||
    t.value = _t.value;
 | 
					    t.value = _t.value;
 | 
				
			||||||
    l.value = _l.value;
 | 
					    l.value = _l.value;
 | 
				
			||||||
 | 
					    props.restore(props.id)
 | 
				
			||||||
  } else {
 | 
					  } else {
 | 
				
			||||||
    _w.value = w.value;
 | 
					    _w.value = w.value;
 | 
				
			||||||
    _h.value = h.value;
 | 
					    _h.value = h.value;
 | 
				
			||||||
@ -260,6 +269,7 @@ const minHandle = () => {
 | 
				
			|||||||
    w.value = minArea().w;
 | 
					    w.value = minArea().w;
 | 
				
			||||||
    t.value = minOffset(left).t;
 | 
					    t.value = minOffset(left).t;
 | 
				
			||||||
    l.value = minOffset(left).l;
 | 
					    l.value = minOffset(left).l;
 | 
				
			||||||
 | 
					    props.min(props.id)
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  min.value = !min.value;
 | 
					  min.value = !min.value;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user