【发布时间】:2020-01-11 04:58:57
【问题描述】:
我有以下循环遍历 store.js 中的一些数据这一切都很好但是我想将 vue is active 条件添加到多边形的类中,但是我不能在不破坏 note.content_type 的情况下处理语法,它提供了动态类名。
一旦我可以在这个元素上设置 { active: isActive } 我想我知道如何将它添加到我的数据中并通过点击或点击来更改它。
<svg xmlns="http://www.w3.org/2000/svg" width="400" height="800" id="space" ref="sheets">
<g
v-for="(note, index) in notes"
:key="'note'+index"
:transform="`translate(${note.xpos}, ${note.ypos})`"
class="draggable"
>
<polygon
v-if="note.content_type == 'link'"
points="9.500000000000002,16.454482671904334 -19,2.326828918379971e-15 9.499999999999986,-16.45448267190434"
fill="#989898"
:class="note.content_type"
:id="note.id"
/>
</g>
再次感谢
【问题讨论】:
标签: javascript css vue.js