Skip to content

Commit

Permalink
scroller: fix disable pullup with slot
Browse files Browse the repository at this point in the history
  • Loading branch information
lichunqiang committed Jul 11, 2016
1 parent e15c5de commit e124fb7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"shake.js": "^1.2.2",
"validator": "^5.1.0",
"vux-blazy": "^1.6.4",
"vux-xscroll": "^3.1.5",
"vux-xscroll": "^3.1.6",
"webp-support": "^1.0.3",
"array-from": "^2.1.1",
"object-assign": "^4.1.0"
Expand Down Expand Up @@ -102,4 +102,4 @@
"webpack-dev-middleware": "^1.4.0",
"webpack-hot-middleware": "^2.6.0"
}
}
}
31 changes: 27 additions & 4 deletions src/demos/PulldownPullup.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
<template>
<div>
<divider>下拉刷新和上拉加载更多组合</divider>
<scroller lock-x scrollbar-y use-pullup use-pulldown height="200px" @pullup:loading="loadMore" @pulldown:loading="refresh" v-ref:scroller>
<scroller lock-x scrollbar-y use-pullup use-pulldown height="200px" @pullup:loading="loadMore" @pulldown:loading="refresh" :pullup-status.sync="pullupStatus" v-ref:scroller>
<div class="box2">
<p v-for="i in n">placeholder {{i}}</p>
</div>
<!--pullup slot-->
<div slot="pullup" class="xs-plugin-pullup-container xs-plugin-pullup-up" style="position: absolute; width: 100%; height: 40px; bottom: -40px; text-align: center;">
<span v-show="pullupStatus === 'default'"></span>
<span class="pullup-arrow" v-show="pullupStatus === 'down' || pullupStatus === 'up'" :class="{'rotate': pullupStatus === 'up'}">↑</span>
<span v-show="pullupStatus === 'loading'"><spinner type="ios-small"></spinner></span>
</div>
</scroller>
<group>
<switch :title="pullupEnabled ? '禁用Pullup' : '启用Pullup'" :value="true" @on-change="changePullupStatus"></switch>
Expand All @@ -20,14 +26,15 @@
</template>

<script>
import { Scroller, Divider, Switch, Group } from '../components'
import { Scroller, Divider, Switch, Group, Spinner } from '../components'
export default {
components: {
Scroller,
Divider,
Switch,
Group
Group,
Spinner
},
methods: {
loadMore (uuid) {
Expand Down Expand Up @@ -72,8 +79,24 @@ export default {
return {
n: 10,
n1: 10,
pullupEnabled: true
pullupEnabled: true,
pullupStatus: 'default'
}
}
}
</script>
<style lang="less" scoped>
.box2-wrap {
height: 300px;
overflow: hidden;
}
.rotate {
display: inline-block;
transform: rotate(-180deg);
}
.pullup-arrow {
transition: all linear 0.2s;
color: #666;
font-size: 25px;
}
</style>

0 comments on commit e124fb7

Please sign in to comment.