Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DiDi
cube-ui
提交
4914304c
C
cube-ui
项目概览
DiDi
/
cube-ui
11 个月 前同步成功
通知
34
Star
9078
Fork
1508
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
cube-ui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4914304c
编写于
11月 28, 2017
作者:
U
ustbhuangyi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
scroll.vue add options prop which is totally match the better-scroll options
上级
da80afd3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
37 addition
and
30 deletion
+37
-30
example/pages/scroll.vue
example/pages/scroll.vue
+9
-3
src/components/scroll/scroll.vue
src/components/scroll/scroll.vue
+28
-27
未找到文件。
example/pages/scroll.vue
浏览文件 @
4914304c
...
...
@@ -46,9 +46,7 @@
<cube-scroll
ref=
"scroll"
:data=
"items"
:scrollbar=
"scrollbarObj"
:pull-down-refresh=
"pullDownRefreshObj"
:pull-up-load=
"pullUpLoadObj"
:options=
"scrollOptions"
@
pulling-down=
"onPullingDown"
@
pulling-up=
"onPullingUp"
>
<template
v-if=
"customPullDown"
slot=
"pulldown"
slot-scope=
"props"
>
...
...
@@ -188,6 +186,13 @@
}
},
computed
:
{
scrollOptions
()
{
return
{
pullDownRefresh
:
this
.
pullDownRefreshObj
,
pullUpLoad
:
this
.
pullUpLoadObj
,
scrollbar
:
this
.
scrollbarObj
}
},
scrollbarObj
:
function
()
{
return
this
.
scrollbar
?
{
fade
:
this
.
scrollbarFade
}
:
false
},
...
...
@@ -311,6 +316,7 @@
color: #666
&.rotate
transform: rotate(180deg)
.scroll-list-wrap
position relative
height: 480px
...
...
src/components/scroll/scroll.vue
浏览文件 @
4914304c
...
...
@@ -58,6 +58,14 @@
const
EVENT_PULLING_DOWN
=
'
pulling-down
'
const
EVENT_PULLING_UP
=
'
pulling-up
'
const
DEFAULT_OPTIONS
=
{
click
:
true
,
probeType
:
1
,
scrollbar
:
false
,
pullDownRefresh
:
false
,
pullUpLoad
:
false
}
export
default
{
name
:
COMPONENT_NAME
,
props
:
{
...
...
@@ -67,13 +75,11 @@
return
[]
}
},
probeType
:
{
type
:
Number
,
default
:
1
},
click
:
{
type
:
Boolean
,
default
:
true
options
:
{
type
:
Object
,
default
()
{
return
{}
}
},
listenScroll
:
{
type
:
Boolean
,
...
...
@@ -87,15 +93,6 @@
type
:
String
,
default
:
DIRECTION_V
},
scrollbar
:
{
default
:
false
},
pullDownRefresh
:
{
default
:
false
},
pullUpLoad
:
{
default
:
false
},
refreshDelay
:
{
type
:
Number
,
default
:
20
...
...
@@ -113,14 +110,22 @@
}
},
computed
:
{
pullUpLoad
()
{
return
this
.
options
.
pullUpLoad
},
pullDownRefresh
()
{
return
this
.
options
.
pullDownRefresh
},
pullUpTxt
()
{
const
moreTxt
=
this
.
pullUpLoad
&&
this
.
pullUpLoad
.
txt
&&
this
.
pullUpLoad
.
txt
.
more
||
DEFAULT_LOAD_TXT_MORE
const
noMoreTxt
=
this
.
pullUpLoad
&&
this
.
pullUpLoad
.
txt
&&
this
.
pullUpLoad
.
txt
.
noMore
||
DEFAULT_LOAD_TXT_NO_MORE
const
pullUpLoad
=
this
.
pullUpLoad
const
moreTxt
=
pullUpLoad
&&
pullUpLoad
.
txt
&&
pullUpLoad
.
txt
.
more
||
DEFAULT_LOAD_TXT_MORE
const
noMoreTxt
=
pullUpLoad
&&
pullUpLoad
.
txt
&&
pullUpLoad
.
txt
.
noMore
||
DEFAULT_LOAD_TXT_NO_MORE
return
this
.
pullUpDirty
?
moreTxt
:
noMoreTxt
},
refreshTxt
()
{
return
this
.
pullDownRefresh
&&
this
.
pullDownRefresh
.
txt
||
DEFAULT_REFRESH_TXT
const
pullDownRefresh
=
this
.
pullDownRefresh
return
pullDownRefresh
&&
pullDownRefresh
.
txt
||
DEFAULT_REFRESH_TXT
}
},
created
()
{
...
...
@@ -140,15 +145,10 @@
this
.
$refs
.
list
.
style
.
minHeight
=
`
${
getRect
(
this
.
$refs
.
wrapper
).
height
+
1
}
px`
}
let
options
=
{
probeType
:
this
.
probeType
,
click
:
this
.
click
,
let
options
=
Object
.
assign
({},
DEFAULT_OPTIONS
,
{
scrollY
:
this
.
direction
===
DIRECTION_V
,
scrollX
:
this
.
direction
===
DIRECTION_H
,
scrollbar
:
this
.
scrollbar
,
pullDownRefresh
:
this
.
pullDownRefresh
,
pullUpLoad
:
this
.
pullUpLoad
}
scrollX
:
this
.
direction
===
DIRECTION_H
},
this
.
options
)
this
.
scroll
=
new
BScroll
(
this
.
$refs
.
wrapper
,
options
)
...
...
@@ -297,6 +297,7 @@
position: relative
z-index: 1
background-color: $scroll-content-bgc
.cube-scroll-item
height: 60px
line-height: 60px
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录