vue3-free-layout
Version:
[vue3+ts]拖动布局,自由拖动,标尺,放大缩小,控件之间的标尺
165 lines (164 loc) • 3.28 kB
CSS
.design {
position: relative;
background-color: #EEEFF0;
display: flex;
flex-direction: column;
}
.design .header {
width: 100%;
height: 50px;
background-color: #ffffff;
}
.design .content {
width: 100%;
flex: 1;
display: flex;
flex-direction: row;
overflow: hidden;
}
.design .content .body {
flex: 1;
height: 100%;
overflow: auto;
}
.design .content .body .ruler_container {
position: absolute;
z-index: 1000;
}
.design .content .body #free-layout-canvas {
position: relative;
left: 0;
top: 0;
transform-origin: left top;
}
.design .content .body #free-layout-canvas #drawer {
position: relative;
box-shadow: 0 0 6px #90909060;
}
.design .content .body #free-layout-canvas #drawer .selected {
cursor: pointer;
box-shadow: 0 0 4px #9a9a9a;
z-index: 99;
}
.design .content .body #free-layout-canvas #drawer .dragging {
cursor: move;
z-index: 2000 ;
box-shadow: 0 0 2px #9a9a9a;
}
.design .content .body #free-layout-canvas #drawer > * {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.design .content .body #free-layout-canvas .selected_area {
position: absolute;
z-index: 1000;
background: rgba(24, 160, 251, 0.1);
border: 1px dashed rgba(24, 160, 251, 0.8);
}
.design .drag_container {
position: absolute;
transform-origin: center;
}
.design .drag_container .cover {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
position: absolute;
left: 0;
top: 0;
box-sizing: border-box;
}
.design .drag_container .hover:hover {
border: 1px solid #108b96;
}
.design .drag_container .moving {
background-color: rgba(100, 172, 255, 0.05);
z-index: 2000;
}
.design .dragging {
cursor: move;
z-index: 2000 ;
box-shadow: 0 0 6px #9a9a9a;
transition: 0.1s left, 0.1s top;
transition-timing-function: ease;
}
.design .moving {
transition-duration: 0.2s;
transition-timing-function: ease;
z-index: 101;
box-shadow: 0 0 6px #9a9a9a;
}
.design .size-border-container {
position: absolute;
z-index: 1510;
margin: 0;
border: 0;
}
.design .size-border-container .border {
background: #108b96;
}
.design .size-border-h {
height: 8px;
cursor: row-resize;
}
.design .size-border-h .border {
margin: 3px 0;
height: 2px;
width: 100%;
}
.design .size-border-v {
width: 8px;
cursor: col-resize;
}
.design .size-border-v .border {
margin: 0 3px;
width: 2px;
height: 100%;
}
.design .size-border-corn {
position: absolute;
z-index: 1520;
width: 12px;
height: 12px;
}
.design .size-border-corn .quart {
margin: 2px;
width: 8px;
height: 8px;
background-color: #fff;
box-sizing: border-box;
border: solid 1px #108b96;
border-radius: 50%;
}
.design .nesw-resize {
cursor: nesw-resize;
}
.design .nwse-resize {
cursor: nwse-resize;
}
.design .size-cover {
position: absolute;
z-index: 1500;
cursor: move;
background: rgba(24, 160, 251, 0.05);
}
.design .alignment-line {
position: absolute;
}
.design .operation-bar {
position: absolute;
display: flex;
justify-content: center;
align-items: center;
padding: 0 2px;
box-sizing: border-box;
z-index: 1900;
}
.design .operation-bar .del-icon {
font-size: 18px;
width: 18px;
height: 18px;
cursor: pointer;
}