Comments (12)
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.
It's so easy to learn from example/index.html
from vue-infinite-scroll.
Doesn't work for me as well. The doCheck
function won't be called.
from vue-infinite-scroll.
from vue-infinite-scroll.
@NerdyGlasses Could you provide an online demo?
from vue-infinite-scroll.
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.
PS. I've removed a bunch of code here. Assume that the fetchNext
method exists.
from vue-infinite-scroll.
OK. Will get back to you after I test this.
from vue-infinite-scroll.
okay white modal view is just a component with a slot.
from vue-infinite-scroll.
@Leopoldthecoder My mistake. I should have seen this. It works well now. Thx for helping me out.
from vue-infinite-scroll.
@NerdyGlasses No problem.
from vue-infinite-scroll.
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)
- not support typescript
- Set "infinite-scroll-immediate-check" to false is not working if the prop sent as boolean HOT 1
- 滚动到底部加载一次后,就开始无限加载,直至全部加载完成bug
- Load callback checking fail when using async function
- 【天坑】此指令不能和v-else一起使用 HOT 3
- 请问当把这个指令使用在弹框这样一开始没有渲染的dom里面这样的情况怎么解决呢? HOT 1
- Firing without reaching bottom HOT 4
- 在微信和QQ内滑动失效?
- 在弹窗内无法使用 HOT 5
- vue-infinite-scroll支持vue3吗 HOT 7
- Stop calling api when I scroll down HOT 1
- 弹框中无法滚动加载,只有把列表封装成组件,可调用正常 HOT 2
- Problems with "page" variable
- Vue 3 support HOT 1
- 还是不能v-if下使用啊,v-show也不行 HOT 1
- Passive scroll listener
- 支持vue3的办法 How to support vue3
- not working in table td element HOT 1
- test
- example中的vue已经无法下载了
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-infinite-scroll.