Comments (5)
Hi @hilongjw , I'm trying to use the list
prop to get data from the recyclerview.
I manage to get the data but pushing a new element into the array does update the list in my data and in the recyclerview component but does not appear in the DOM. Maybe I need to update the count?
How should this be used to update the list and reproduce a common chat that appends a new message to array?
Thanks for answering to all my queries!!!
from vue-recyclerview.
Try to call RecyclerView's internal methods
RecyclerView.scroller.setItems(newList)
vm.$nextTick(() => {
RecyclerView.scroller.onResize_()
})
from vue-recyclerview.
Doing so seems to be doing something but quite right. I mean the items increment in the array (the strange thing is if the list it's just one item longer It will show that has 2 more) but old messages and tombstone overlap ones I was sawing.
Here is a screencap:
from vue-recyclerview.
@hazzo I tried to rewrite my chat demo, part of the code:
replyMessage () {
setTimeout(() => {
this.addMsg(null, false)
}, 500 + 1500 * Math.random())
},
addMsg (msg, sender, cb) {
const RecyclerView = this.$refs.RecyclerView
wechatFetch.getItem()
.then(data => {
if (msg) data.message = msg
data.self = sender
cb && cb()
RecyclerView.scroller.MAX_COUNT += 1
RecyclerView.scroller.addContent([data])
RecyclerView._scrollToBottom()
})
},
addMessage () {
this.addMsg(this.input, true, () => {
this.input = ''
this.replyMessage()
})
},
from vue-recyclerview.
Cool!
from vue-recyclerview.
Related Issues (20)
- Errors beforeDestroy component HOT 14
- Enhancement: Tombstone height defines how many elements get set in DOM HOT 5
- Is it possible to pass extra props to component? HOT 6
- Suport for multiple tombstone templates
- Feature: Fetch on scrolling up, not bottom HOT 7
- Plugins props are always undefined
- Parent component not accessable HOT 2
- 作者啊,给个浏览器端集成的例子吧
- How to update the List after render?
- 使用瀑布流的时候,图片空白
- 提一下意见,这库不好用 HOT 1
- element-ui table 怎么使用呢?
- this.options.usePrefix - Cannot read property "usePrefix" of undefined
- 可以用在微信小程序上吗?mpvue框架?
- Simplified usage HOT 2
- Example confussing HOT 2
- Suggestion: Start list from end HOT 3
- Scrolling to last index in list (bottom) render problem HOT 5
- Prerender and Remain default values HOT 2
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-recyclerview.