升级 layer-vue 1.2.3
This commit is contained in:
		
							parent
							
								
									e22c521980
								
							
						
					
					
						commit
						9f0bec1339
					
				@ -108,6 +108,7 @@ const handlerScroll = () => {
 | 
			
		||||
 | 
			
		||||
const handlerCollapse = () => {
 | 
			
		||||
  iconType.value = show.value ? "layui-icon-right" : "layui-icon-left";
 | 
			
		||||
  // @ts-ignore
 | 
			
		||||
  scrollRefEl.value!.firstElementChild!.style.marginRight = show.value
 | 
			
		||||
    ? "180px"
 | 
			
		||||
    : "0px";
 | 
			
		||||
@ -118,7 +119,7 @@ watch(show, () => {
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
onMounted(() => {
 | 
			
		||||
  // TODO 封装 hooks
 | 
			
		||||
  // @ts-ignore TODO 封装 hooks
 | 
			
		||||
  scrollRefEl.value = document.querySelector(".layui-body");
 | 
			
		||||
  if (!scrollRefEl.value) {
 | 
			
		||||
    throw new Error(`scroll element is not existed: ".layui-body"`);
 | 
			
		||||
@ -126,8 +127,8 @@ onMounted(() => {
 | 
			
		||||
  scrollRefEl.value.scrollTop = 0;
 | 
			
		||||
  scrollRefEl.value?.addEventListener("scroll", throttle(handlerScroll, 500));
 | 
			
		||||
  // 如果已折叠,关闭组件初始渲染时的动画,然后自动开启
 | 
			
		||||
  show.value =
 | 
			
		||||
    scrollRefEl.value!.firstElementChild!.style.marginRight !== "0px";
 | 
			
		||||
  // @ts-ignore
 | 
			
		||||
  show.value = scrollRefEl.value!.firstElementChild!.style.marginRight !== "0px";
 | 
			
		||||
  enableAnimation = show.value;
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -34,7 +34,7 @@
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "@layui/hooks-vue": "^0.1.6",
 | 
			
		||||
    "@layui/icons-vue": "^1.0.2",
 | 
			
		||||
    "@layui/layer-vue": "^1.2.2",
 | 
			
		||||
    "@layui/layer-vue": "^1.2.3",
 | 
			
		||||
    "async-validator": "^4.0.7",
 | 
			
		||||
    "countup.js": "^2.0.8",
 | 
			
		||||
    "evtd": "^0.2.3",
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user