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

解决效果

相关推荐
HelloReader20 分钟前
Flutter ChangeNotifier用 ViewModel 管理应用状态(九)
前端
用户40993225021221 分钟前
Vue 3 静态与动态 Props 如何传递?TypeScript 类型约束有何必要?
前端·vue.js·后端
程序员库里22 分钟前
TipTap简介
前端·javascript·面试
关中老四22 分钟前
【js/web甘特图插件MZGantt】如何使用外部弹框添加和修改任务(updRows方法使用说明)
前端·javascript·甘特图·甘特图插件
兆子龙24 分钟前
Vite 打包优化实战:从 12.17M 到 7.95M 的瘦身之旅
javascript
nunumaymax30 分钟前
css实现元素和文字从右向左排列
前端·css
confiself41 分钟前
A2UI实时渲染展示
开发语言·javascript·css
旷世奇才李先生1 小时前
043校园二手交易平台系统-springboot+vue
java·vue.js·spring boot
yatum_20141 小时前
CentOS 7 集群 SSH 免密与主机名配置文档
linux·前端·网络