GithubHelp home page GithubHelp logo

Comments (6)

tserkov avatar tserkov commented on June 10, 2024

What browser/version are you using?

from vue-scroll-reveal.

MissakaI avatar MissakaI commented on June 10, 2024

This was in Firefox Developer Edition 67.0b10

Edge returns it as TypeError: Unable to get property 'reveal' of undefined or null reference

from vue-scroll-reveal.

tserkov avatar tserkov commented on June 10, 2024

I'm not able to replicate your issue -- would you be able to provide me with a minimal repo that reproduces your issue?

from vue-scroll-reveal.

MissakaI avatar MissakaI commented on June 10, 2024

I've created a repo as requested. You can find it here.

from vue-scroll-reveal.

tserkov avatar tserkov commented on June 10, 2024
  • Move Vue.use(VueScrollReveal, ...) into main.js instead of views/Home.vue
  • vue-scroll-reveal is intended to be primarily used as a directive, not programmatically. For example, inside of components/page_components/home_page/timelineItem.vue:
<div
    class="timeline-panel"
    v-scroll-reveal.reset="{ origin: contentPosition }"
    style="..."
>
  • When accessing $sr from within components (like within mounted()), try accessing it via this.$sr instead of Vue.$sr.

from vue-scroll-reveal.

MissakaI avatar MissakaI commented on June 10, 2024

When accessing $sr from within components (like within mounted()), try accessing it via this.$sr instead of Vue.$sr.

They earlier reason I was unsuccessful with this keyword because I have been using the mounted hook incorrectly with the arrow expression ()=> where as it should be function(){} according to vue documentation.

But console.log(this.$sr) outputs the object with reveal function within yet when reveal is called as this.$sr.reveal() it returns TypeError: this.$sr.reveal(...) is undefined. I've included a possible workaround for this.

vue-scroll-reveal is intended to be primarily used as a directive, not programmatically. 

Noted. But I cannot convert the all of the components to use that use ScrollReveal to directive as there are quite a number of components that use these classes.

As my approach didn't work i tried as you mentioned using directive apporoach as well. But it didn't render any animations nor any errors.

from vue-scroll-reveal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.