Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
anyefeiyu
uni-app
提交
db032655
U
uni-app
项目概览
anyefeiyu
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
db032655
编写于
3月 07, 2019
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 解决swiper组件动态设置current-item-id不生效的问题
上级
de835654
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
30 deletion
+11
-30
src/core/view/components/swiper-item/index.vue
src/core/view/components/swiper-item/index.vue
+0
-16
src/core/view/components/swiper/index.vue
src/core/view/components/swiper/index.vue
+11
-14
未找到文件。
src/core/view/components/swiper-item/index.vue
浏览文件 @
db032655
...
...
@@ -12,14 +12,6 @@ export default {
default
:
''
}
},
watch
:
{
itemId
(
val
,
oldVal
)
{
this
.
_itemIdUpdated
(
val
,
oldVal
)
}
},
created
()
{
this
.
_itemIdUpdated
(
this
.
itemId
,
this
.
itemId
)
},
mounted
:
function
()
{
var
$el
=
this
.
$el
$el
.
style
.
position
=
'
absolute
'
...
...
@@ -31,14 +23,6 @@ export default {
callback
()
})
}
},
methods
:
{
_itemIdUpdated
(
val
,
oldVal
)
{
var
$parent
=
this
.
$parent
if
(
$parent
&&
typeof
$parent
.
_itemIdUpdated
===
'
function
'
)
{
$parent
.
_itemIdUpdated
(
this
,
val
,
oldVal
)
}
}
}
}
</
script
>
...
...
src/core/view/components/swiper/index.vue
浏览文件 @
db032655
...
...
@@ -69,8 +69,7 @@ export default {
currentItemIdSync
:
this
.
currentItemId
||
''
,
userTracking
:
false
,
currentChangeSource
:
''
,
items
:
[],
itemIdItemMap
:
{}
items
:
[]
}
},
computed
:
{
...
...
@@ -143,9 +142,6 @@ export default {
displayMultipleItemsNumber
()
{
this
.
_resetLayout
()
}
// itemIdItemMap () {
// this._resetLayout()
// }
},
created
()
{
this
.
_invalid
=
true
...
...
@@ -172,14 +168,6 @@ export default {
this
.
_cancelSchedule
()
},
methods
:
{
_itemIdUpdated
(
item
,
val
,
oldVal
)
{
if
(
oldVal
)
{
this
.
$set
(
this
.
itemIdItemMap
,
oldVal
,
null
)
}
if
(
val
)
{
this
.
$set
(
this
.
itemIdItemMap
,
val
,
item
.
$vnode
)
}
},
_inintAutoplay
(
enable
)
{
if
(
enable
)
{
this
.
_scheduleAutoplay
()
...
...
@@ -191,7 +179,16 @@ export default {
* 页面变更检查和同步
*/
_currentCheck
()
{
var
current
=
this
.
items
.
indexOf
(
this
.
itemIdItemMap
[
this
.
currentItemId
])
var
current
=
-
1
if
(
this
.
currentItemId
)
{
for
(
let
i
=
0
,
items
=
this
.
items
;
i
<
items
.
length
;
i
++
)
{
let
componentInstance
=
items
[
i
].
componentInstance
if
(
componentInstance
&&
componentInstance
.
itemId
===
this
.
currentItemId
)
{
current
=
i
break
}
}
}
if
(
current
<
0
)
{
current
=
Math
.
round
(
this
.
current
)
||
0
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录