<script setup>
import {ref} from "vue";
const left_width=ref(0)
const center_width=ref(24)
const right_width=ref(0)
const flex_change = (type)=>{
switch (type){
case 1:
left_width.value = 8;
center_width.value = 16;
right_width.value = 0;
break
case 2:
left_width.value = 0;
center_width.value = 24;
right_width.value = 0;
break
case 3:
left_width.value = 0;
center_width.value = 16;
right_width.value = 8;
break
}
}
</script>
<template>
<div class="login-content">
<el-row>
<el-col :span="left_width" class="content-col"> 1 </el-col>
<el-col :span="center_width" class="content-col">
<div class="demo">
方块
</div>
</el-col>
<el-col :span="right_width" class="content-col">
<el-row style="height: 100%">
<el-col :offset="6" :span="12" class="block">
</el-col>
</el-row>
</el-col>
</el-row>
</div>
<div class="flex-tool">
<el-row>
<el-col :span="8" @click="flex_change(1)">
居左
</el-col>
<el-col :span="8" @click="flex_change(2)">
居中
</el-col>
<el-col :span="8" @click="flex_change(3)">
居右
</el-col>
</el-row>
</div>
</template>
<style scoped>
.login-content{
height:100vh;
width:100vw;
background-color: gray;
}
.flex-tool{
background-color: white;
height: 30px;
width: 120px;
border-radius: 20px;
position: absolute;
right: 20px;
top: 10px;
text-align: center;
line-height: 30px;
cursor: pointer;
font-size: 12px;
}
.content-col{
height: 50vh;
margin-top: 25vh;
background-color: red;
border: 2px green solid;
}
.demo{
margin: 0 auto;
margin-top: calc(25vh - 50px);
background-color: aquamarine;
width: 100px;
height: 100px;
text-align: center;
line-height: 100px;
}
.block{
background-color: blue;
height: 100%;
}
</style>
常驻大哥24分法,记得看
镜宇秋霖丶2026-05-08 10:01
相关推荐
螺丝钉tina9 分钟前
[Playwright ][16]Playwright + TypeScript API 自动化测试实战:API测试小天源1 小时前
智叟云集系统 · 架构与职责分层Highcharts.js2 小时前
React 中原生支持使用 JSX 组件配置自定义表格 Highcharts GridJava后端的Ai之路3 小时前
【AIAgent开发】-Agent工具封装成CLI(纯干货!!!)薛定谔的猫-菜鸟程序员3 小时前
Electron开发超详细教程(从入门到放弃)最强小杰3 小时前
DeepSeek V4 Flash + Codex CLI 接入教程:原生 Responses API 适配,从配置到跑通收藏这篇就够了(2026)静水leo4 小时前
使用 Whistle 拦截接口并模拟后端响应掘金者阿豪4 小时前
SQL Server数据迁移完成后,凌晨的数据库告警该怎么查?小郎君6584 小时前
Vue 多标签页的加载态设计:为什么我没有用 Suspense 实现 PageLoadingJudithHuang4 小时前
React 嵌套路由与布局