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;
}

解决效果

相关推荐
用户新2 小时前
V8引擎 精品漫游指南--Ignition篇(下 一) 动态执行前的事情
前端·javascript
@PHARAOH4 小时前
WHAT - GitLens vs Fork
前端
yqcoder4 小时前
前端性能优化:如何减少重绘与重排?
前端·性能优化
洋子5 小时前
Yank Note 系列 13 - 让 AI Agent 进入笔记工作流
前端·人工智能
wenzhangli77 小时前
Ooder A2UI 核心架构深度解析:WEB 拦截层的设计与实现
前端·架构
前端百草阁7 小时前
【前端性能优化全链路指南】从开发编写到构建运行的多维度实践
前端·性能优化
神探小白牙8 小时前
eCharts 多系列柱状图增加背景图
javascript·ecmascript·echarts
女生也可以敲代码8 小时前
AI时代下的50道前端开发面试题:从基础到大模型应用
前端·面试
ZhengEnCi8 小时前
M5-markconv自定义CSS样式指南 📝
前端·css·python
IT_陈寒8 小时前
SpringBoot自动配置的坑差点让我加班到天亮
前端·人工智能·后端