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

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

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理