可拖动header
创建DraggableTopBar
在全局css中添加
header {
-webkit-app-region: drag;
}
创建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 */;
}
添加在APP组件中即可
Last updated