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

解决效果

相关推荐
beckyye13 分钟前
ant design vue Table根据数据合并单元格
前端·antd
布列瑟农的星空17 分钟前
还在手动翻译国际化词条?AST解析+AI翻译实现一键替换
前端·后端·ai编程
土豆125031 分钟前
Rust 错误处理完全指南:从入门到精通
前端·rust·编程语言
QT 小鲜肉1 小时前
【Linux命令大全】001.文件管理之mmove命令(实操篇)
linux·服务器·前端·chrome·笔记
前端开发爱好者1 小时前
VSCode 重磅更新!要收费了?
前端·javascript·visual studio code
烛阴1 小时前
C# 正则表达式(4):分支与回溯引用
前端·正则表达式·c#
wuhen_n2 小时前
LeetCode -- 1:两数之和(简单)
javascript·算法·leetcode·职场和发展
曹牧2 小时前
Java:Assert.isTrue()
java·前端·数据库
脾气有点小暴2 小时前
uniapp自定义头部导航
前端·uni-app
假装我不帅2 小时前
jquery.nicescroll使用
前端·javascript·jquery