Git Product home page Git Product logo

Comments (8)

OriginalEXE avatar OriginalEXE commented on July 17, 2024 1

Maybe try this:

methods: {
  resize () {
    this.$refs.flickity.resize()
  }
},

mounted () {
  this.$nextTick(() => {
    this.resize()
  })
}

from vue-flickity.

p3lican avatar p3lican commented on July 17, 2024

Thanks a lot for the reply. Unfortunately nothing changes on my end.
I put a console.log below the nextTick just to make sure it was being fired and I did see the console.log.

methods: {
    resize() {
      this.$refs.flickity.resize();
    },
  },
 mounted () {
    this.$nextTick(() => {
      this.resize()
    })
      console.log("This.resize was fired but did nothing")
  },

from vue-flickity.

bardiaabasirad avatar bardiaabasirad commented on July 17, 2024

Any solution for this problem?

from vue-flickity.

bardiaabasirad avatar bardiaabasirad commented on July 17, 2024

Any solution for this problem?

I use setTimeout with 1 second but it not a good idea!

resize() { setTimeout(() => { this.$refs.flickity.resize(); },1000); }

from vue-flickity.

EnzoBatista avatar EnzoBatista commented on July 17, 2024

Use this.$refs.flickity.rerender(); instead of this.$refs.flickity.resize();

works for me ;)

from vue-flickity.

emdahlstrom avatar emdahlstrom commented on July 17, 2024

@EnzoBatista Hm, interesting! That doesn't work for me, I can't seem to find this rerender() method in the flickity api or on the flickity object. Can you tell us a bit more?

from vue-flickity.

EnzoBatista avatar EnzoBatista commented on July 17, 2024

@emdahlstrom Dude, i've used rerender() method in nuxt like this this.$refs.flickity.rerender();, but i think it's available in react js too and in some way you can do this in vue js

from vue-flickity.

mihalidis avatar mihalidis commented on July 17, 2024

Use this.$refs.flickity.rerender(); instead of this.$refs.flickity.resize();

works for me ;)

Not work for me now :/ we're using SSR btw maybe that's why didn't work

from vue-flickity.

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.