Vue组件置底方法,ElementPlus布局

问题描述

在开发网页时使用了elementplus的el-container组件

组件里分成了main和footer两块,但是想要将两个按钮置底在容器底部遇到了困难

如下图所示,在网页开发者工具可见两个按钮与左侧的图片没有底部对齐

此时我的代码是这样

javascript 复制代码
<el-footer>
   <el-row :gutter="20" style="  display: flex;justify-content: space-between;">
      <el-space>
        <el-col :span="6">
            <el-button @click="button1function" type="primary">button1</el-button>
        </el-col>
        <el-col :span="6">
            <el-button @click="button2function" type="primary">button2</el-button>
        </el-col>
      </el-space>
   </el-row> 
</el-footer>

解决办法

javascript 复制代码
<el-footer class="align-bottom">
   <el-row :gutter="20" style="  display: flex;justify-content: space-between;">
      <el-space>
        <el-col :span="6">
            <el-button @click="button1function" type="primary">button1</el-button>
        </el-col>
        <el-col :span="6">
            <el-button @click="button2function" type="primary">button2</el-button>
        </el-col>
      </el-space>
   </el-row> 
</el-footer>


//在<style>里加入以下代码
.align-bottom {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

解决效果

相关推荐
天蓝色的鱼鱼11 分钟前
Next.js路由全解析:Pages Router 与 App Router,你选对了吗?
前端·next.js
xun_xing15 分钟前
基于Nextjs15的学习手记
前端·javascript·react.js
有意义19 分钟前
Vibe Coding:人机共生时代的开发革命 —— 从概念到 Chrome 扩展实战
前端·ai编程·vibecoding
梅梅绵绵冰31 分钟前
SpringMVC快速入门
前端
kirkWang31 分钟前
HarmonyOS 6.0 服务卡片实战:把「轻食刻」装进桌面,让轻断食一眼可控
前端
1024小神33 分钟前
VNBarcodeObservation的结果中observation.boundingBox 是什么类型?
前端
xun_xing39 分钟前
Javascript的Iterator和Generator
前端·javascript
秃了才能变得更强40 分钟前
React Native 新、旧架构集成原生模块方式
前端
1024小神43 分钟前
swift中VNDetectBarcodesRequest VNImageRequestHandler 是什么?有什么作用?VN是什么意思
前端
加个鸡腿儿1 小时前
React项目实战 | 修复Table可展开行,点击一个全部展开
前端·react.js·编程语言