提交 344418eb 编写于 作者: 雪洛's avatar 雪洛

feat: 修改scroll-view direction属性

上级 f6246747
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
</list-view> </list-view>
</view> </view>
<scroll-view style="flex:1" direction="y"> <scroll-view style="flex:1" direction="vertical">
<view class="content"> <view class="content">
<boolean-data :defaultValue="false" title="设置当前下拉刷新状态,true 表示下拉刷新已经被触发,false 表示下拉刷新未被触发" <boolean-data :defaultValue="false" title="设置当前下拉刷新状态,true 表示下拉刷新已经被触发,false 表示下拉刷新未被触发"
@change="change_refresher_triggered_boolean"></boolean-data> @change="change_refresher_triggered_boolean"></boolean-data>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<page-head title="非下拉刷新的scroll-view属性示例"></page-head> <page-head title="非下拉刷新的scroll-view属性示例"></page-head>
<view class="uni-margin-wrap"> <view class="uni-margin-wrap">
<!-- 暂时分成两个方向不同的滚动视图,原因为:scroll-view组件不支持动态改变direction。 --> <!-- 暂时分成两个方向不同的滚动视图,原因为:scroll-view组件不支持动态改变direction。 -->
<scroll-view v-if="scrollX" direction="x" :scroll-top="scrollTop" :scroll-left="scrollLeft" <scroll-view v-if="scrollX" direction="horizontal" :scroll-top="scrollTop" :scroll-left="scrollLeft"
:upper-threshold="upperThreshold" :lower-threshold="lowerThreshold" :scroll-into-view="scrollIntoView" :upper-threshold="upperThreshold" :lower-threshold="lowerThreshold" :scroll-into-view="scrollIntoView"
:enable-back-to-top="enableBackToTop" :scroll-with-animation="scrollWithAnimation" style="flex-direction: row;width: 100%;height: 100%;" :enable-back-to-top="enableBackToTop" :scroll-with-animation="scrollWithAnimation" style="flex-direction: row;width: 100%;height: 100%;"
:show-scrollbar="showScrollbar" :bounces="bounces" @scrolltoupper="scrolltoupper" :show-scrollbar="showScrollbar" :bounces="bounces" @scrolltoupper="scrolltoupper"
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<text class="uni-text">{{item.label}}</text> <text class="uni-text">{{item.label}}</text>
</view> </view>
</scroll-view> </scroll-view>
<scroll-view v-else direction="y" :scroll-top="scrollTop" :scroll-left="scrollLeft" <scroll-view v-else direction="vertical" :scroll-top="scrollTop" :scroll-left="scrollLeft"
:upper-threshold="upperThreshold" :lower-threshold="lowerThreshold" :scroll-into-view="scrollIntoView" :upper-threshold="upperThreshold" :lower-threshold="lowerThreshold" :scroll-into-view="scrollIntoView"
:enable-back-to-top="enableBackToTop" :scroll-with-animation="scrollWithAnimation" :enable-back-to-top="enableBackToTop" :scroll-with-animation="scrollWithAnimation"
:show-scrollbar="showScrollbar" :bounces="bounces" @scrolltoupper="scrolltoupper" :show-scrollbar="showScrollbar" :bounces="bounces" @scrolltoupper="scrolltoupper"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view style="flex:1;"> <view style="flex:1;">
<page-head title="下拉刷新的scroll-view属性示例"></page-head> <page-head title="下拉刷新的scroll-view属性示例"></page-head>
<view class="uni-margin-wrap"> <view class="uni-margin-wrap">
<scroll-view direction="y" :refresher-enabled="refresherEnabled" :refresher-threshold="refresherThreshold" <scroll-view direction="vertical" :refresher-enabled="refresherEnabled" :refresher-threshold="refresherThreshold"
:refresher-default-style="refresherDefaultStyle" :refresher-background="refresherBackground" :refresher-default-style="refresherDefaultStyle" :refresher-background="refresherBackground"
:refresher-triggered="refresherTriggered" @refresherpulling="refresherpulling" :refresher-triggered="refresherTriggered" @refresherpulling="refresherpulling"
@refresherrefresh="refresherrefresh" @refresherrestore="refresherrestore" @refresherrefresh="refresherrefresh" @refresherrestore="refresherrestore"
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<text class="uni-subtitle-text">纵向滚动</text> <text class="uni-subtitle-text">纵向滚动</text>
</view> </view>
<view> <view>
<scroll-view :scroll-top="scrollTop" direction="y" class="scroll-Y" scroll-with-animation="true" <scroll-view :scroll-top="scrollTop" direction="vertical" class="scroll-Y" scroll-with-animation="true"
@scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll"> @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll">
<view class="scroll-view-item uni-bg-red"><text class="text">A</text></view> <view class="scroll-view-item uni-bg-red"><text class="text">A</text></view>
<view class="scroll-view-item uni-bg-green"><text class="text">B</text></view> <view class="scroll-view-item uni-bg-green"><text class="text">B</text></view>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<text class="uni-subtitle-text">横向滚动</text> <text class="uni-subtitle-text">横向滚动</text>
</view> </view>
<view> <view>
<scroll-view class="scroll-view_H" direction="x" @scroll="scroll" :scroll-left="120"> <scroll-view class="scroll-view_H" direction="horizontal" @scroll="scroll" :scroll-left="120">
<view class="scroll-view-item_H uni-bg-red"><text class="text">A</text></view> <view class="scroll-view-item_H uni-bg-red"><text class="text">A</text></view>
<view class="scroll-view-item_H uni-bg-green"><text class="text">B</text></view> <view class="scroll-view-item_H uni-bg-green"><text class="text">B</text></view>
<view class="scroll-view-item_H uni-bg-blue"><text class="text">C</text></view> <view class="scroll-view-item_H uni-bg-blue"><text class="text">C</text></view>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册