Created
November 16, 2016 14:11
-
-
Save misakuo/c1c5ca952bf307ef14c0a0e796e4fea1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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