Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DiDi
cube-ui
提交
370f5aca
C
cube-ui
项目概览
DiDi
/
cube-ui
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
提交
370f5aca
编写于
4月 09, 2018
作者:
D
dolymood
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix only one slide item loop
上级
a3f96b89
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
16 addition
and
30 deletion
+16
-30
src/components/slide/slide.vue
src/components/slide/slide.vue
+16
-30
未找到文件。
src/components/slide/slide.vue
浏览文件 @
370f5aca
...
...
@@ -119,6 +119,9 @@
if
(
this
.
showDots
)
{
this
.
_initDots
()
}
if
(
this
.
currentPageIndex
>=
this
.
dots
.
length
)
{
this
.
currentPageIndex
=
this
.
dots
.
length
-
1
}
this
.
_initSlide
()
if
(
this
.
autoPlay
)
{
...
...
@@ -130,41 +133,24 @@
this
.
slide
.
refresh
()
},
_updateSlideDom
(
isResize
)
{
if
(
this
.
direction
===
DIRECTION_H
)
{
this
.
_setSlideWidth
(
isResize
)
}
else
{
this
.
_setSlideHeight
(
isResize
)
}
},
_setSlideWidth
(
isResize
)
{
this
.
children
=
this
.
$refs
.
slideGroup
.
children
let
width
=
0
let
slideWidth
=
this
.
$refs
.
slide
.
clientWidth
for
(
let
i
=
0
;
i
<
this
.
children
.
length
;
i
++
)
{
let
child
=
this
.
children
[
i
]
child
.
style
.
width
=
slideWidth
+
'
px
'
width
+=
slideWidth
}
if
(
this
.
loop
&&
!
isResize
)
{
width
+=
2
*
slideWidth
}
this
.
$refs
.
slideGroup
.
style
.
width
=
width
+
'
px
'
this
.
_setSlideStyle
(
isResize
)
},
_setSlide
Height
(
isResize
)
{
_setSlide
Style
(
isResize
)
{
this
.
children
=
this
.
$refs
.
slideGroup
.
children
let
height
=
0
let
slideHeight
=
this
.
$refs
.
slide
.
clientHeight
for
(
let
i
=
0
;
i
<
this
.
children
.
length
;
i
++
)
{
let
child
=
this
.
children
[
i
]
child
.
style
.
height
=
slideHeight
+
'
px
'
height
+=
slideHeight
const
target
=
this
.
direction
===
DIRECTION_H
?
'
width
'
:
'
height
'
let
allSize
=
0
const
slideSize
=
this
.
$refs
.
slide
[
`client
${
target
[
0
].
toUpperCase
()
+
target
.
slice
(
1
)}
`
]
const
len
=
this
.
children
.
length
for
(
let
i
=
0
;
i
<
len
;
i
++
)
{
const
child
=
this
.
children
[
i
]
child
.
style
[
target
]
=
slideSize
+
'
px
'
allSize
+=
slideSize
}
if
(
this
.
loop
&&
!
isResize
)
{
height
+=
2
*
slideHeight
if
(
this
.
loop
&&
!
isResize
&&
len
>
1
)
{
allSize
+=
2
*
slideSize
}
this
.
$refs
.
slideGroup
.
style
.
height
=
height
+
'
px
'
this
.
$refs
.
slideGroup
.
style
[
target
]
=
allSize
+
'
px
'
},
_initSlide
()
{
const
eventPassthrough
=
this
.
direction
===
DIRECTION_H
&&
this
.
allowVertical
?
DIRECTION_V
:
''
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录