<div  style="border-radius:10px" @mouseover="mouseOver"  :style="active" @mouseleave="mouseLeave"> 
</div>
data(){
    return{
    active:""
}
}
methods(){
        mouseOver(){
        //改变样式
              this.active = 'background-color: rgb(235,235,235)';
        },
        mouseLeave() {
        //清空样式
            this.active = '';
        },
}

 

Logo

前往低代码交流专区

更多推荐