Dom节点定义数据 发表于 2024-01-11 更新于 2025-03-09 分类于 thinks 阅读次数: 1234567<!-->Yo, this is for a Vue project<--><div class="test-div" :vote-badge="`${blog.voteCount}`"></div><div class="test-div1" :style="{'--item-count':item.count}" :vote-badge="`${blog.voteCount}`"></div> 1234567.test-div:after { content: attr(vote-badge);}.test-div1 { height: calc(var(--item-count) * 40px);}