23 鼠标移入移出更换样式

在要移入移出的组件上面添加样式

 添加初始样式、移入移出样式

<template>
  <div>
      <div  class="changeStyle">
          要移入移出组件
      </div>
  </div>
</template>

<script>
export default {
  data() {
    return {

    }
  },
created() {

},
methods: {

},
}
</script>

<style scoped>

.changeStyle{
  border: 1px solid black;
   200px;
  height: 200px;
  background: white;
}
.changeStyle:focus{
color:#333 !important;
background: rgb(233, 16, 16) !important;
}
.changeStyle:hover{
color:#333 !important;
background: rgb(216, 231, 9) !important;
}
</style>

  

原文地址:https://www.cnblogs.com/gfbzs/p/13206537.html