这是结构
<a-tree
class="device-tree-node"
showIcon
:expandedKeys="expandedKeys"
:autoExpandParent="autoExpandParent"
:treeData="treeData"
@expand="onExpand"
:selectedKeys="selectedKeys"
:multiple="isMultiple"
@select="onTreeSelect"
:style="{ width: deviceTreeWidth }"
@rightClick="test($event)"
>
<span class="line" v-if="item.lineIcon && showLineIcon" @click.stop>
<img src="@/assets/device-tree/line2.png" @click="vShowLine" alt="" />
<img src="@/assets/device-tree/line1.png" @click="beginPatrol" alt="" />
<a @click="showTimeList = true">{{ timeNum || "时长" }}
<li @click="setTime(5000)">5s
<li @click="setTime(10000)">10s
<li @click="setTime(15000)">15s
<li @click="setTime(20000)">20s
这是样式
/deep/ .device-tree-node {
margin-bottom: 20px;
width: 250px;
height: 660px;
overflow: auto;
background: url("~@/assets/device-tree/tree-border.png") no-repeat;
background-size: 100% 100%;
position: relative;
/deep/ .line {
position: absolute;
right: -120px;
display: inline-flex;
align-items: center;
z-index: 100;
img {
margin-right: 5px;
}
}
.ant-select-selection__rendered {
line-height: 20px !important;
margin-right: 0;
margin-left: 8px;
}