Code Monkey home page Code Monkey logo

Comments (12)

Leopoldthecoder avatar Leopoldthecoder commented on July 27, 2024 2

Hi @NerdyGlasses, at the top of your script, change

import infiniteScroll from 'vue-infinite-scroll'

to

import { infiniteScroll } from 'vue-infinite-scroll'

or

var infiniteScroll = require('vue-infinite-scroll').infiniteScroll

vue-infinite-scroll exports an object and what you need is the infiniteScroll part. See here.

from vue-infinite-scroll.

xsbchen avatar xsbchen commented on July 27, 2024

It's so easy to learn from example/index.html

from vue-infinite-scroll.

heygambo avatar heygambo commented on July 27, 2024

Doesn't work for me as well. The doCheck function won't be called.

from vue-infinite-scroll.

furybean avatar furybean commented on July 27, 2024

@Leopoldthecoder

from vue-infinite-scroll.

Leopoldthecoder avatar Leopoldthecoder commented on July 27, 2024

@NerdyGlasses Could you provide an online demo?

from vue-infinite-scroll.

heygambo avatar heygambo commented on July 27, 2024

Unfortunately I'm not able to create an online demo. But this is my code.

I've added a console.log('binding') to the bind: function bind() function to see if it will be called. Nothing happens.

I've added another console.log('evaluating') right above the throttle function to check if it will be evaluated. It will be.

<template>
  <div class="unique-ids-modal">
    <white-modal-view headline="Unique IDs" v-ref:modal>
      <ul class="unique-ids"
          v-infinite-scroll="fetchNext()"
          :infinite-scroll-disabled="loading"
          :infinite-scroll-distance="30">
        <li class="unique-id" v-for="uniqueId in uniqueIds">{{ uniqueId.uuid }}</li>
      </ul>
    </white-modal-view>
  </div>
</template>

<script>
import infiniteScroll from 'vue-infinite-scroll'
import WhiteModalView from './WhiteModalView'

export default {
  name: 'UniqueIdsModalView',

  directives: {
    infiniteScroll
  },

  components: {
    WhiteModalView
  },

  data () {
    return {
      loading: false,
      count: 0,
      next_page: true,
      page: 1,
      uniqueIds: []
    }
  }
}
</script>

<style lang="sass">

.unique-ids-modal

  .unique-ids
    height: 200px
    overflow: auto

</style>

from vue-infinite-scroll.

heygambo avatar heygambo commented on July 27, 2024

PS. I've removed a bunch of code here. Assume that the fetchNext method exists.

from vue-infinite-scroll.

Leopoldthecoder avatar Leopoldthecoder commented on July 27, 2024

OK. Will get back to you after I test this.

from vue-infinite-scroll.

heygambo avatar heygambo commented on July 27, 2024

okay white modal view is just a component with a slot.

from vue-infinite-scroll.

heygambo avatar heygambo commented on July 27, 2024

@Leopoldthecoder My mistake. I should have seen this. It works well now. Thx for helping me out.

from vue-infinite-scroll.

Leopoldthecoder avatar Leopoldthecoder commented on July 27, 2024

@NerdyGlasses No problem.

from vue-infinite-scroll.

VictorPulzz avatar VictorPulzz commented on July 27, 2024

In my code this dont work
image

loadDisable have true value. And when I scroll nothing happens!!!
My imports:
import infiniteScroll from 'vue-infinite-scroll' Vue.use(infiniteScroll)

from vue-infinite-scroll.

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.