fix(TreeSelect): use scroll-view to prevent page scroll event @rex-zsd (#867)

This commit is contained in:
rex 2018-11-06 19:11:36 +08:00 committed by neverland
parent 58c5d2f54d
commit 16b569971f
2 changed files with 7 additions and 8 deletions

View File

@ -11,9 +11,7 @@
left: 0; left: 0;
top: 0; top: 0;
bottom: 0; bottom: 0;
overflow: scroll;
background-color: @white; background-color: @white;
-webkit-overflow-scrolling: touch;
} }
&__nitem { &__nitem {
@ -32,10 +30,10 @@
} }
&__content { &__content {
width: 65%;
padding: 0 15px; padding: 0 15px;
margin-left: 35%; margin-left: 35%;
overflow: scroll; box-sizing: border-box;
-webkit-overflow-scrolling: touch;
} }
&__item { &__item {

View File

@ -2,7 +2,7 @@
class="van-tree-select" class="van-tree-select"
style="height: {{ mainHeight }}px" style="height: {{ mainHeight }}px"
> >
<view class="van-tree-select__nav"> <scroll-view scroll-y class="van-tree-select__nav">
<view <view
wx:for="{{ items }}" wx:for="{{ items }}"
wx:key="index" wx:key="index"
@ -12,8 +12,9 @@
> >
{{ item.text }} {{ item.text }}
</view> </view>
</view> </scroll-view>
<view <scroll-view
scroll-y
class="van-tree-select__content" class="van-tree-select__content"
style="height: {{ itemHeight }}px" style="height: {{ itemHeight }}px"
> >
@ -31,5 +32,5 @@
class="van-tree-select__selected" class="van-tree-select__selected"
/> />
</view> </view>
</view> </scroll-view>
</view> </view>