Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DiDi
cube-ui
提交
99b5e6bb
C
cube-ui
项目概览
DiDi
/
cube-ui
9 个月 前同步成功
通知
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,体验更适合开发者的 AI 搜索 >>
提交
99b5e6bb
编写于
6月 24, 2019
作者:
T
tank0317
提交者:
doly mood
6月 24, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(scroll): forceUpdate (#526)
* fix: forceUpdate * fix: rename * fix: indexList foceUpdate
上级
d93fe2e3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
28 addition
and
20 deletion
+28
-20
src/components/index-list/index-list.vue
src/components/index-list/index-list.vue
+2
-2
src/components/scroll/scroll.vue
src/components/scroll/scroll.vue
+26
-18
未找到文件。
src/components/index-list/index-list.vue
浏览文件 @
99b5e6bb
...
@@ -169,8 +169,8 @@
...
@@ -169,8 +169,8 @@
titleClick
()
{
titleClick
()
{
this
.
$emit
(
EVENT_TITLE_CLICK
,
this
.
title
)
this
.
$emit
(
EVENT_TITLE_CLICK
,
this
.
title
)
},
},
forceUpdate
(
dirty
)
{
forceUpdate
(
dirty
=
false
,
nomore
=
false
)
{
this
.
$refs
.
scroll
.
forceUpdate
(
dirty
)
this
.
$refs
.
scroll
.
forceUpdate
(
dirty
,
nomore
)
dirty
&&
this
.
$nextTick
(()
=>
{
dirty
&&
this
.
$nextTick
(()
=>
{
this
.
_calculateHeight
()
this
.
_calculateHeight
()
})
})
...
...
src/components/scroll/scroll.vue
浏览文件 @
99b5e6bb
...
@@ -306,20 +306,24 @@
...
@@ -306,20 +306,24 @@
clickItem
(
item
)
{
clickItem
(
item
)
{
this
.
$emit
(
EVENT_CLICK
,
item
)
this
.
$emit
(
EVENT_CLICK
,
item
)
},
},
forceUpdate
(
dirty
=
false
,
nomore
=
false
)
{
async
forceUpdate
(
dirty
=
false
,
nomore
=
false
)
{
if
(
this
.
isPullDownUpdating
)
{
return
}
if
(
this
.
pullDownRefresh
&&
this
.
isPullingDown
)
{
if
(
this
.
pullDownRefresh
&&
this
.
isPullingDown
)
{
this
.
isPullingDown
=
false
this
.
isPullingDown
=
false
this
.
_reboundPullDown
(()
=>
{
this
.
isPullDownUpdating
=
true
this
.
_afterPullDown
(
dirty
)
await
this
.
_waitFinishPullDown
()
})
await
this
.
_waitResetPullDown
(
dirty
)
this
.
isPullDownUpdating
=
false
}
else
if
(
this
.
pullUpLoad
&&
this
.
isPullUpLoad
)
{
}
else
if
(
this
.
pullUpLoad
&&
this
.
isPullUpLoad
)
{
this
.
isPullUpLoad
=
false
this
.
isPullUpLoad
=
false
this
.
scroll
.
finishPullUp
()
this
.
scroll
.
finishPullUp
()
this
.
pullUpNoMore
=
!
dirty
||
nomore
this
.
pullUpNoMore
=
!
dirty
||
nomore
dirty
&&
this
.
refresh
()
}
else
{
dirty
&&
this
.
refresh
()
}
}
dirty
&&
this
.
refresh
()
},
},
resetPullUpTxt
()
{
resetPullUpTxt
()
{
this
.
pullUpNoMore
=
false
this
.
pullUpNoMore
=
false
...
@@ -472,19 +476,23 @@
...
@@ -472,19 +476,23 @@
this
.
isPullUpLoad
=
true
this
.
isPullUpLoad
=
true
this
.
$emit
(
EVENT_PULLING_UP
)
this
.
$emit
(
EVENT_PULLING_UP
)
},
},
_
rebound
PullDown
(
next
)
{
_
waitFinish
PullDown
(
next
)
{
const
{
stopTime
=
DEFAULT_STOP_TIME
}
=
this
.
pullDownRefresh
const
{
stopTime
=
DEFAULT_STOP_TIME
}
=
this
.
pullDownRefresh
setTimeout
(()
=>
{
return
new
Promise
(
resolve
=>
{
this
.
scroll
.
finishPullDown
()
setTimeout
(()
=>
{
next
()
this
.
scroll
.
finishPullDown
()
},
stopTime
)
resolve
()
},
stopTime
)
})
},
},
_afterPullDown
(
dirty
)
{
_waitResetPullDown
(
dirty
)
{
this
.
resetPullDownTimer
=
setTimeout
(()
=>
{
return
new
Promise
(
resolve
=>
{
this
.
pullDownStyle
=
`top: -
${
this
.
pullDownHeight
}
px`
this
.
resetPullDownTimer
=
setTimeout
(()
=>
{
this
.
beforePullDown
=
true
this
.
pullDownStyle
=
`top: -
${
this
.
pullDownHeight
}
px`
dirty
&&
this
.
refresh
()
this
.
beforePullDown
=
true
},
this
.
scroll
.
options
.
bounceTime
)
resolve
()
},
this
.
scroll
.
options
.
bounceTime
)
})
},
},
_getPullDownEleHeight
()
{
_getPullDownEleHeight
()
{
let
pulldown
=
this
.
$refs
.
pulldown
let
pulldown
=
this
.
$refs
.
pulldown
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录