html:代码
<ul>
            <li @click="current='xxxx'" :class="{active:current=='xxxx'}">休息休息</li>
            <li @click="current='xxxx1'" :class="{active:current=='xxxx1'}">休息休息</li>
            <li @click="current='xxxx2'" :class="{active:current=='xxxx2'}">休息休息</li>
            <li @click="current='xxxx3'" :class="{active:current=='xxxx3'}">休息休息</li>
        </ul>
css样式:
.active {
        background: rgb(21,149,136);
        color: white;
        border: 1px solid green;
    }
js代码:
export default {
    name: '',
    data() {
      return {
        current:'xxxx',
      }
    },
}

 

相关文章:

  • 2021-07-16
  • 2022-12-23
  • 2021-04-23
  • 2021-09-01
  • 2021-06-15
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-30
  • 2022-12-23
  • 2022-02-27
相关资源
相似解决方案