首页 > 技术文章 > div 实现光标悬停变成手型

CF1314 2020-11-24 10:11 原文

div 实现光标悬停变成手型

最近的项目中有一个光标悬停在 div 标签上变成手型,点击并触发事件的需求。

然后了解到 css有个特定的样式,如下:

cursor: pointer;

js代码如下:

<!-- 更多按钮 -->
    <div class="more-action">
        <el-popover placement="bottom" width="100" trigger="click">
            <!-- 需求举报 -->
            <div class="report" @click="openchildReport(orderData.id)">举报</div>

<i slot="reference" class="el-icon-more"></i>
</el-popover>
</div>

css代码如下:

.report {
    text-align: center;
    cursor: pointer;
}

至此问题解决。

推荐阅读