Skip to content

Instantly share code, notes, and snippets.

@misakuo
Created November 16, 2016 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save misakuo/c1c5ca952bf307ef14c0a0e796e4fea1 to your computer and use it in GitHub Desktop.
Save misakuo/c1c5ca952bf307ef14c0a0e796e4fea1 to your computer and use it in GitHub Desktop.
<style>
.text-wrap{
height:200;
width:750;
background-color : #ff6000;
margin-bottom : 10;
justify-content: center;
align-items: center;
}
.text{
font-size: 50;
}
.header-wrap{
background-color : #000000;
margin-bottom : 10;
justify-content: center;
align-items: center;
}
.header {
color :#ffffff;
}
</style>
<template>
<list onloadmore="loadmore" loadmoreoffset="500">
<cell>
<div class="text-wrap">
<text class="text">111111</text>
</div>
</cell>
<cell>
<div class="text-wrap">
<text class="text">111111</text>
</div>
</cell>
<cell>
<div class="text-wrap">
<text class="text">111111</text>
</div>
</cell>
<cell>
<div class="text-wrap">
<text class="text">111111</text>
</div>
</cell>
<header>
<div class="text-wrap header-wrap">
<text class="header">滚动到这里,我会置顶哦</text>
</div>
</header>
<cell repeat="{{item in list}}">
<div class="text-wrap">
<text class="text">{{item.text}}</text>
</div>
</cell>
</list>
</template>
<script>
var index = 0;
module.exports = {
data : {
list : []
},
ready: function (){
this.loadmore();
},
methods : {
loadmore : function() {
var _this = this;
setTimeout(function(){
for(var i = 0; i < 5; i++){
_this.list.push({text : index++});
}
}, 500);
}
}
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment