组件用法见element-plus官网。
做出有按钮的tooltip,修改tooltip的样式,用deep不太好使,因为你用控制台选不中它,光标一挪开就没了。给它加popper-class然后慢慢调吧。这样做的坏处是(不加scoped)会全局样式污染。
<template>
<div class="cmain">
<div class="right">
<div
v-for="(item,index) in mapTools"
:key="index"
:class="[
'center',
item.selected? 'active': '',
]"
@click="changeTool(item)"
>
<el-tooltip v-if="item.name =='view'" effect="dark" :content="item.label" placement="left" popper-class="popper">
<img :src="item.icon" />
<template #content >
<div class="inner">
<div
v-for="(item,index) in viewType"
:key="index"
:class="[
'center',
item.selected? 'active': '',
]"
@click="changeViewType(item)"
>
{
{
item.label }}
</div>
</div>
</template>
</el-tooltip>
<el-tooltip v-if="item.name !='view'" effect="dark" :content="item.label" placement="left">