根据官方文档,使用popper-class参数为tooltip添加自定义内容;其中该类名注意不能够加scope标签中,否则无效。
<el-tooltip effect="dark" :popper-class="'box-item'" :hide-after="100" placement="right">
<template #content>{{ areaDetail }}</template>
<div class="font-size-base text-color-white line-height-2 text-spacing-2">
{{ areaDetail }}
</div>
</el-tooltip>
<style lang="scss">
.box-item {
background-color: rgba(6, 20, 37, 0.6) !important;
max-width: 510px !important;
margin-top: 10px;
}
</style>