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

解决效果

相关推荐
林太白4 分钟前
vue3这些常见指令你封装了吗
前端·javascript
Tzarevich16 分钟前
算法效率的核心:时间复杂度与空间复杂度
javascript·算法
傻啦嘿哟19 分钟前
Python在Excel中创建与优化数据透视表的完整指南
java·前端·spring
拜晨25 分钟前
用流式 JSON 解析让 AI 产品交互提前
前端·javascript
浩男孩28 分钟前
🍀vue3 + Typescript +Tdesign + HiPrint 打印下载解决方案
前端
andwhataboutit?29 分钟前
LANGGRAPH
java·服务器·前端
无限大630 分钟前
为什么"Web3"是下一代互联网?——从中心化到去中心化的转变
前端·后端·程序员
cypking32 分钟前
CSS 常用特效汇总
前端·css
程序媛小鱼36 分钟前
openlayers撤销与恢复
前端·js
Thomas游戏开发37 分钟前
如何基于全免费素材,0美术成本开发游戏
前端·后端·架构