可拖动header

创建DraggableTopBar

  1. 在全局css中添加

header {

-webkit-app-region: drag;

}
  1. 创建component

export const DraggableTopBar = () => {

return <header className="absolute inset-0 h-8 bg-transparent" />

}
.absolute {  
	position: absolute;  
}
  
.inset-0 {  
	top: 0px;  
	right: 0px;  
	bottom: 0px;  
	left: 0px;  
}
.h-8 {  
	height: 2rem /* 32px */;  
}
  1. 添加在APP组件中即可

Last updated