vue.js css last-child 効かない
vue.jsでlast-childが効かないぞ?
結論
hoge.vue
<style>
.kudamono .kudamono-item {
background-color: blue;
}
.kudamono .kudamono-item:last-child {
background-color: red !important;
}
</style>
<div class="kudamono">
<div v-for="(v,key) in menu" class="kudamono-item">
{{v.body}}
</div>
</div>
これで効く。
- v-forの外側にclassを作る
- 上記でv-forのdivを囲い設定する
といった感じです
Author And Source
この問題について(vue.js css last-child 効かない), 我々は、より多くの情報をここで見つけました https://qiita.com/ma7ma7pipipi/items/c3a23307d9a91b22f7cf著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .