K
K
Konstantin Malyarov2018-03-26 00:06:28
Vue.js
Konstantin Malyarov, 2018-03-26 00:06:28

How to execute once in VueJS v-for loop?

There is a v-for loop. How can I make style only apply to the first div?
Something like this

<div v-for="item in items" :style.once="padding: 10px">{{item.name}}</>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
2
2perca, 2018-03-26
@Konstantin18ko

easier to solve with css :first-child than fuss with array element index and if

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question