tserkov / vue-scroll-reveal

A Vue directive to wrap @jlmake's excellent ScrollReveal library.
MIT License
163 stars 17 forks source link

Dynamically set scroll reveal on certain elements in a loop #39

Closed Samiam519 closed 2 years ago

Samiam519 commented 2 years ago

Is there a property to dynamically turn the entire scroll reveal on or off?

For example

<div v-for="(a, i) in articles" :key="'article-'+i">
          <Article
              v-scroll-reveal="{ active: openCards.includes(a.id) }"
              :title="a.title"
              :link="a.link"
              :content="a.content"
              :id="a.id"
          />
        </div>
      </div>

I tried this but it didn't work

<div v-for="(a, i) in articles" :key="'article-'+i">
          <Article
              :v-scroll-reveal="openCards.includes(a.id)"
              :title="a.title"
              :link="a.link"
              :content="a.content"
              :id="a.id"
          />
        </div>
      </div>
tserkov commented 2 years ago

I think setting duration to 0 should have the intended effect.