• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
技术杨的博客园
希望每一次的努力都能得到自己想要的
博客园    首页    新随笔    联系   管理    订阅  订阅

element-ui el-table 高度自适应

element-ui  el-table 高度自适应


<div ref="searchHeader" class="div_search search_title" :class="{ div_search_index: !isExpand }">
<el-form ref="dataForm" :model="listQuery" label-position="left" label-width="70px">
<el-form-item class="div_item input_search" label="所属机构">
<org-tree @get-orgid="changeOrg"></org-tree>
</el-form-item>
<el-form-item class="div_item input_search" label="排查内容">
<el-input class="filter-item" v-model="listQuery.content"></el-input>
</el-form-item>
<div class="left">
<el-button @click="getList(1)" class="button_search" size="medium" type="primary">查询</el-button>
<el-button @click="editClick(null,'新建')" class="button_search" size="medium" type="primary">新建</el-button>
</div>
</el-form>
</div>
<el-table
      ref="refTable" :data="list"
      v-loading="listLoading"
      element-loading-text="加载中" fit
      highlight-current-row
      style="width: 100%"
      :max-height="maxHeight">
      <el-table-column type="index" width="50"> </el-table-column>
      <el-table-column  min-width="120" align="center" prop="orgName" label="所属机构"></el-table-column>
      <el-table-column  min-width="120" align="center" prop="areaName" label="所属部门"></el-table-column>
      <el-table-column  min-width="150" align="center" prop="stateSign" label="状态">
         <template slot-scope="scope">{{ scope.row.stateSign | state}}</template>
      </el-table-column>
      <el-table-column  min-width="150" align="center"label="操作">
         <template slot-scope="scope">
       <el-button @click="editClick(scope.row,'编辑')">编辑</el-button>
  </template>
</el-table>
data: function () {
return {
    maxHeight: null,
  };
},
methods:{
  setHeight: function () {
   var that = this;
   var screenHeight = document.documentElement.clientHeight || document.body.clientHeight;
   that.maxHeight = screenHeight - that.$refs.searchHeader.clientHeight - 156;
  },
}

 

posted @ 2022-09-29 13:37  技术杨  阅读(380)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3