vue实现鼠标放上去就有提示_css – 如何在VueJS中实现鼠标悬停?

任何人都可以帮助实现UL的鼠标功能,

我的模板中有一组使用相同类的UL标签,但是当我尝试实现鼠标悬停(在鼠标悬停时更改边框颜色)时,所有带有该类的UL标签都会突出显示.

我对VUE很陌生.

模板

Notification

Message

脚本

data() {

return {

sbitmcls: "image",

active: true

};

},

methods: {

onClick() {

this.$router.push("/homepage");

},

mouseOver: function(name) {

this.sbitmcls = "imageSelected"

},

mouseOut: function() {

event.target.style.background = "#4a4b45";

}

}

样式:

.image {

display: relative;

background-color: #4a4b45;

color: white;

font-family: Rubik, "Bookman", Garamond, "Times New Roman", Times, serif;

font-size: 1.2em;

font-style: bold;

line-height: 2em;

height: 5%;

border-left: 5px solid #4a4b45;

margin-right: 50px;

margin: 1px 0;

padding-left: 1em;

}

.imageSelected {

display: relative;

background-color: #575a51;

color: white;

font-family: Rubik, "Bookman", Garamond, "Times New Roman", Times, serif;

font-size: 1.2em;

font-style: bold;

line-height: 2em;

height: 5%;

border-left: 5px solid blue;

margin-right: 50px;

margin: 1px 0;

padding-left: 1em;

}

有没有更好的方法来实现这个?

谢谢,

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值