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

解决效果

相关推荐
XiaoYu200214 分钟前
第3章 Nest.js拦截器
前端·ai编程·nestjs
千寻girling20 分钟前
面试官 : “ 说一下 Map 和 WeakMap 的区别 ? ”
前端·javascript·面试
2501_9240641125 分钟前
2025年主流Web自动化测试工具功能与适用场景对比
前端·测试工具·自动化
可触的未来,发芽的智生32 分钟前
一万个为什么:频率和相位
javascript·人工智能·python·程序人生·自然语言处理
IT_陈寒38 分钟前
Vite 5 实战:7个鲜为人知的配置技巧让构建速度提升200%
前端·人工智能·后端
gg1593572846039 分钟前
JavaScript 核心基础
前端·javascript·vue.js
Stanford_11061 小时前
【2026新年启程】学习之路,探索之路,技术之路,成长之路……都与你同行!!!
前端·c++·学习·微信小程序·排序算法·微信开放平台
打小就很皮...1 小时前
网页包装为桌面应用(Nativefier版)
前端·桌面应用·nativefier
拾荒李1 小时前
性能优化-手搓定高虚拟列表实现
javascript·性能优化
自由生长20241 小时前
为什么我们需要流式系统?
前端