forked from horizon0514/vue-iscroll
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
102c23f
commit 10b36f8
Showing
4 changed files
with
220 additions
and
11 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,65 @@ | ||
<template> | ||
<div id="app"> | ||
<h1>{{ msg }}</h1> | ||
<scroll :bottom-height="btnHeight" :use-pull-down="true"> | ||
<ul></ul> | ||
</scroll> | ||
<button class="btn" style="'height':btnHeight">button</button> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import scroll from './scroll.vue' | ||
export default { | ||
components: { | ||
scroll | ||
}, | ||
data () { | ||
return { | ||
// note: changing this line won't causes changes | ||
// with hot-reload because the reloaded component | ||
// preserves its current state and we are modifying | ||
// its initial state. | ||
msg: 'Hello Vue!' | ||
btnHeight: '48px' | ||
} | ||
}, | ||
ready(){ | ||
setTimeout(()=>{ | ||
let html = ''; | ||
for(let i=0;i<20;i++){ | ||
html += '<li>'+i+'</li>'; | ||
} | ||
document.querySelector('ul').innerHTML = html; | ||
this.$broadcast('scroll-reset','container'); | ||
},2000) | ||
}, | ||
methods: { | ||
onScrollEnd(){ | ||
console.log('end') | ||
}, | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
body { | ||
font-family: Helvetica, sans-serif; | ||
overflow:hidden; | ||
} | ||
ul{ | ||
list-style: none; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
li{ | ||
height: 40px; | ||
background: #d45; | ||
border: 1px solid #f5f5f5; | ||
border-width: 1px 0 0 0; | ||
} | ||
.btn{ | ||
height: 48px; | ||
position: absolute; | ||
left: 0; | ||
width: 100%; | ||
bottom: 0; | ||
background: green; | ||
border: none; | ||
} | ||
</style> |
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