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 分钟前
我用uniapp开发app用到的uniapp插件
前端·vue.js·uni-app
小白每天学一点2 分钟前
微信小程序开发学习-8
javascript·css·微信小程序·小程序·html
柳一航13 分钟前
HTML笔记
前端·笔记·html
艾小码34 分钟前
为什么你的Vue组件总出bug?可能是少了这份测试指南
前端·vue.js·debug
IT_陈寒34 分钟前
Redis 性能提升30%的7个关键优化策略,90%开发者都忽略了第3点!
前端·人工智能·后端
辞忧*1 小时前
基于element-Plus的el-tooltip封装公共虚拟引用组件
前端·vue.js
by__csdn1 小时前
Electron入门:跨平台桌面开发指南
前端·javascript·vue.js·typescript·electron·html
Nan_Shu_6144 小时前
学习:ES6(2)
前端·学习·es6
命运之光7 小时前
【最新】ChromeDriver最新版本下载安装教程,ChromeDriver版本与Chrome不匹配问题
前端·chrome