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