Skip to content

Commit

Permalink
fix(scroll-view):fix content can not respond to click events
Browse files Browse the repository at this point in the history
  • Loading branch information
xxyan0205 committed Jul 23, 2018
1 parent 834d208 commit 2c08a8c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions components/scroll-view/demo/cases/demo0.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@
>
<div
v-for="i in list"
:key="i"
class="scroll-view-item"
:key="i"
@click="$_onItemClick(i)"
>
{{i}}
</div>
</md-scroll-view>
</div>
</template>

<script>import {ScrollView} from 'mand-mobile'
<script>import {ScrollView, Toast} from 'mand-mobile'
export default {
name: 'scroll-view-demo-0',
Expand All @@ -40,6 +41,9 @@ export default {
}
},
methods: {
$_onItemClick(i) {
Toast.info(`Click ${i}`)
},
$_onScroll({scrollLeft, scrollTop}) {
console.log(`[Mand Mobile ScrollView - demo0 - onScroll] scrollLeft: ${scrollLeft}, scrollTop: ${scrollTop}`)
},
Expand Down
2 changes: 1 addition & 1 deletion components/scroll-view/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ export default {
return
}
this.scroller.doTouchStart(event.touches, event.timeStamp)
event.preventDefault()
},
$_onScollerTouchMove(event) {
if (!this.scroller) {
return
}
event.preventDefault()
this.scroller.doTouchMove(event.touches, event.timeStamp, event.scale)
},
$_onScollerTouchEnd(event) {
Expand Down

1 comment on commit 2c08a8c

@xxyan0205
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.