关于前端:elementui-eltree组件flex布局出现横向滚动条

42次阅读

共计 665 个字符,预计需要花费 2 分钟才能阅读完成。

flex 布局 el-tree 能呈现纵向滚动条,不能失常呈现横向滚动条

<div style="width: 100%; height: 100%; display:flex; flex-direction: column;">
    <i-input placeholder="输出关键字查问" v-model="filterText">
      <i slot="suffix" class="el-input__icon el-icon-search"></i>
    </i-input>
    <div style="flex:1; margin-top: 10px; overflow:auto; white-space: nowrap;">
        <el-tree
          class="filter-tree"
          :props="defaultProps"
          :show-checkbox="showCheckBox"
          :default-expand-all="defExpand === 0"
          node-key="treeId"
          :expand-on-click-node="false"
          :filter-node-method="_filterNode"
          :check-strictly="checkWay !== 1"
          @node-click="_handleNodeClick"
          @check="_nodeCheck"
          :data="treeData"
          ref="tree">
        </el-tree>
    </div>
  </div>

解决办法:

/deep/.el-tree{
  display:inline-block;
  min-width:100%;
}

正文完
 0