当前位置:
首页 >
vue3.0动态循环icon点击变色,再次点击取消选中
发布时间:2024/3/24
55
豆豆
生活随笔
收集整理的这篇文章主要介绍了
vue3.0动态循环icon点击变色,再次点击取消选中
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
先看效果图
点击后发生改变
开始上代码
html部分
css部分代码
.left-circle {display: flex;padding-left: 92px;.whole-circle {width: 60%;height: 100%;}.whole-list {width: 40%;height: 100%;ul {li {display: flex;align-items: center;padding: 20px 10px;span {margin: 0 10px;}.icon {width: 12px;height: 12px;border-radius: 50%;cursor: pointer;}.iconactived {background: #cccccc !important;}.name {font-size: 22px;font-weight: 500;color: #3aaeff;}.value {font-size: 38px;font-weight: bold;color: #ffffff;}.type {color: #00d9ff;font-size: 30px;font-weight: bold;}.unit {display: flex;margin: 0;font-size: 22px;font-weight: 300;color: #ffffff;span {opacity: 0.3;margin: 0 2px;}}}}}}vue3.0JS部分关键代码
关于ref这个响应式引用可以看官网带 ref 的响应式变量
总结
以上是生活随笔为你收集整理的vue3.0动态循环icon点击变色,再次点击取消选中的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: html页面icon字体无法显示,Boo
- 下一篇: Vue基础理论篇