element ui tree组件怎么设置滚动条
<el-tree class="el-scrollbar tree" :data="areaList" node-key="id" default-expand-all
:expand-on-click-node="false" @current-change="currentChange">
<span class="custom-tree-node" slot-scope="{ node, data }">
<span>{{ node.label }}</span>
<span class="butotn">
<slot name="operate" :treeData="data"></slot>
</span>
</span>
</el-tree>
//css样式
.tree {
display: inline-block;
}
给tree元素添加el-scrollbar 和自定义class类名,并给el-tree的父元素设置overflow:auto
//全局样式
.Tree[data-v-610b47e2]::-webkit-scrollbar {
width: 5px;
height: 5px;
}
//内嵌滚动条样式
.Tree[data-v-610b47e2]::-webkit-scrollbar-thumb {
border-radius: 1px;
background-color: #40a0ff65;
}
//外部样式
.Tree[data-v-610b47e2]::-webkit-scrollbar-track {
background-color: #f3f3f3;
}