效果:
代码:
<!-- vue html -->
<template>
<div>
<div class="itemTitle" :title="title">{
{ title }}</div>
</div>
</template>
<script setup>
const title = ref("《动物迷惑行为大赏128》")
</script>
// less
.itemTitle:hover::after{
display: none;
/*这里显示的内容为title属性对应的值*/
content: attr(title);
z-index: 99;
}